home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / text1 / macros / txt1m403.tex < prev    next >
Text File  |  1991-10-23  |  139KB  |  3,312 lines

  1. %                                          MACROS FOR TEXT1
  2. %
  3. %         This work is protected as an unpublished work under
  4. %         U.S. copyright laws.
  5. %         Copyright 1987, by Washington State University.
  6. %         All rights reserved.
  7. %
  8. %               Last updated on 9/4/91
  9. %
  10. \everyjob{\immediate\write16{TEXT1 Version 4.03}
  11.           \titlepage\spn{1}
  12. }
  13. %     If this is for the Macintosh, use the alternate \include code
  14. %
  15. %   Here are the changes necessary for the IBM PC/DOS version of TEXT1.
  16. %
  17. %      1. The filetype (extension) can only be 3 characters at the most
  18. %         for the PC/DOS version.
  19. %         This requires the following changes:
  20. %            toc1     => tc1
  21. %            toc2     => tc2
  22. %            toc3     => tc3
  23. %            endnotes => end
  24. %            textext  => txt
  25. %            texmath  => mth
  26. %            texmodel => mdl
  27. %
  28. %      2. The Compugraphics dependent stuff in \selectspecificfont must
  29. %         be omitted.
  30. %
  31. %      3. The routines \nonIBM and \IBM should be set to null
  32. %
  33. %
  34. \catcode`* = 11
  35. \catcode`@ = 11
  36. %
  37. %           Some temporary variables to be used throughout
  38. %
  39. \newbox\A
  40. \newtoks\B
  41. \newskip\C
  42. \newdimen\D
  43. \newdimen\*D
  44. \newcount\E
  45. \newcount\F
  46. \newcount\G
  47. \newcount\N
  48. \newcount\Q
  49. \newcount\R
  50. %             \T \U \V \W are used throughout TEXT1 as temp definitions
  51. %             \I \J \K \M \X \Y \Z are temporary too, be careful if you use these
  52. %
  53. % ragged rightindent on bq troublesome.
  54. % titleleadskip works only with titlepage command in text.
  55. % for doublecolumns, change hsize and line--refer to ccndbl
  56. % for multiple right and centerline--refer to aztex
  57. %
  58. %           IBM/NONIBM character definitions, added by Dean 7/11/86
  59. %
  60. % Use this macro when not printing with IBM standard distribution fonts
  61. %\newif\if*IBM \*IBMfalse
  62. \def\nonIBM{}%\if*IBM \*IBMfalse%
  63. %   \def\aa{\accent23a}%
  64. %   \def\AA{\leavevmode\setbox0\hbox{h}\dimen@\ht0\advance\dimen@-1ex%
  65. %     \rlap{\raise.67\dimen@\hbox{\char'27}}A}%
  66. %   \def\c##1{\setbox\z@\hbox{##1}\ifdim\ht\z@=1ex\accent24 ##1%
  67. %     \else{\ooalign{\hidewidth\char24\hidewidth\crcr\unhbox\z@}}\fi}%
  68. %   \def\`##1{{\accent18 ##1}}%
  69. %   \def\'##1{{\accent19 ##1}}%
  70. %   \def\^##1{{\accent94 ##1}}\let\^^D=\|%
  71. %   \def\~##1{{\accent"7E ##1}}%
  72. %   \def\"##1{{\accent"7F ##1}}%
  73. %   \chardef\i="10 % dummy dotless lowercase i
  74. %   \def\dag{\mathhexbox279}%
  75. %   \def\ddag{\mathhexbox27A}%
  76. %   \def\S{\mathhexbox278}%
  77. %   \def\P{\mathhexbox27B}%
  78. %   \let\}=\rbrace%
  79. %   \let\{=\lbrace%
  80. %   \def\cents{\hbox{\rm\rlap/c}}\fi}% end non-IBM
  81. %
  82. % Use this macro when printing with the IBM standard distribution fonts
  83. \def\IBM{}%\*IBMtrue
  84. %   \chardef\aa="8A % a overcircle
  85. %   \chardef\AA="8B % A overcircle
  86. %   \chardef\c="18 % cedilla
  87. %   \chardef\`="12 % grave
  88. %   \chardef\'="13 % acute
  89. %   \chardef\^="5E % circumflex
  90. %   \chardef\~="7E % tilde
  91. %   \chardef\"="7F % umlaut
  92. %   \chardef\i="69 % dummy dotless lowercase i
  93. %   \chardef\S="DC % section number sign
  94. %   \chardef\P="DD % paragraph sign or pilcrow
  95. %   \chardef\dag="DE % dagger or obelisk
  96. %   \chardef\ddag="DF % double dagger or diesis
  97. %   \chardef\{="AE % left brace
  98. %   \chardef\}="AF % right brace
  99. %   \chardef\cents="CD}% end IBM
  100. %
  101. % Redefined from PLAIN.TEX to omit the at sign "@"
  102. %    @ symbol will be read as begin and end math mode otherwise
  103. \newdimen\zZ \zZ=0pt % can be used both for 0pt and 0
  104. \mathchardef\zmz=1000
  105. \mathchardef\zMz=10000
  106. \mathchardef\zMMz=20000
  107. \def~{\penalty\zMz\ } % tie
  108. \def\break{\penalty-\zMz}
  109. \def\nobreak{\penalty \zMz}
  110. \def\allowbreak{\penalty \zZ}
  111. \def\supereject{\par\penalty-\zMMz}
  112. \def\nopagenumbers{\rhf{\bothpages{}}\rff{\bothpages{}}}
  113. %
  114. %  Redefined from PLAIN.TEX to \unskip last skip if in h mode
  115. %
  116. \def\removelastskip{\ifvmode\ifdim\lastskip=\z@\else\vskip-\lastskip\fi
  117.                             \else\unskip\unskip\unskip\unskip\fi}
  118. \let\rlsk=\removelastskip
  119. %
  120. %  Redefined from PLAIN.TEX to 12 point topskip
  121. \def\raggedbottom{\topskip 12\p@ plus60\p@ \r@ggedbottomtrue}%
  122. \def\normalbottom{\topskip 12\p@ \r@ggedbottomfalse}%
  123. %
  124. %  Redefined from PLAIN.TEX to omit extraneous skips and such surprises.
  125. \def\endinsert{\egroup % finish the \vbox
  126.   \if@mid \dimen@\ht\z@ \advance\dimen@\dp\z@
  127.     \advance\dimen@12\p@ \advance\dimen@\pagetotal
  128.     \ifdim\dimen@>\pagegoal\@midfalse\p@gefalse\fi\fi
  129.   \if@mid \box\z@\goodbreak
  130.   \else\insert\topins{\penalty100 % floating insertion
  131.     \splittopskip\z@skip
  132.     \splitmaxdepth\maxdimen \floatingpenalty\z@
  133.     \ifp@ge \dimen@\dp\z@
  134.     \vbox to\vsize{\unvbox\z@\kern-\dimen@}% depth is zero
  135.     \else \box\z@\nobreak\fi}\fi\endgroup}
  136. %
  137. %         Redefined from PLAIN.TEX to take mode into account
  138. \mathchardef\*dda="227A
  139. \mathchardef\*dag="2279
  140. \mathchardef\*neg="023A
  141. \def\ddagger{\relax\ifmmode\*dda\else$\*dda$\fi}%
  142. \def\dagger{\relax\ifmmode\*dag\else$\*dag$\fi}%
  143. \def\neg{\relax\ifmmode\*neg\else$\*neg$\fi}
  144. %
  145. %         Redefined from PLAIN.TEX to take present font size into account
  146. %
  147. \def\strut{\relax
  148.     \setbox\strutbox=\hbox{\vrule height 1.8ex depth .6ex width 0pt}%
  149.     \ifmmode\copy\strutbox\else\unhcopy\strutbox\fi}%
  150. %
  151. %
  152. %   Starting TEXT1 Definitions
  153. %
  154. %  Use this one for Textures
  155. %
  156. %\def\include#1{\special {picture #1}}%
  157. %
  158. \def\include#1{\special {IPS #1}}%     added by gap 1/27/87
  159. \let\incl=\include
  160. %
  161. \def\text#1{{\it\TeX T1}}%             added by drg 9/26/86
  162. \def\bf{\bd}%                          added by jkw 6/30/86
  163. \def\cents{\hbox{\rm\rlap/c}}%         added by jkw 6/30/86
  164. \def\fraction#1/#2 {%                  added by jkw 7/8/86
  165.   \leavevmode\kern.1em \raise.6ex\hbox{\the\scriptfont0 #1}\kern-.1em
  166.   /\kern-.15em\lower.25ex\hbox{\the\scriptfont0 #2}}
  167. \let\frac=\fraction
  168. %                      Bibliography
  169. %
  170. \newtoks\bi*f     \bi*f={\goodbreak\vs{1\bl}\hp\nin}      % init bibentry
  171. \newtoks\bi*t     \bi*t={\dumpinsertseject\cl{\bd\bibtitle}
  172.                             \vs{1\bl}}% init bibliography title format
  173. \newtoks\bi*r     \bi*r={width 3em height .6ex depth -.5ex}
  174. \newcount\bi*n    \bi*n=0            % counter for numbered bibliography
  175. \newif\if*TC*bib  \*TC*bibtrue
  176. %
  177. \long\def\bibliographyformat#1{{% definition of bibliographic format
  178.       \def\incontents##1{\global\*TC*bibtrue
  179.             \edef\T{##1}%
  180.             \edef\U{yes}%
  181.             \edef\V{no}%
  182.             \ifx \T\U              % Already true
  183.                  \else \ifx \T\V \global\*TC*bibfalse
  184.                        \else \message{<TEXT1> Warning, argument to
  185.                                       incontents in bibliographyformat is not "yes" or "no".
  186.                                       "yes" will be assumed}
  187.                  \fi\fi}%
  188.     \long\def\everybibentry##1{\global\bi*f={##1}}%
  189. %      Remove this some day
  190.     \let\bibentryformat=\everybibentry%
  191.     \long\def\titleformat##1{\global\bi*t={##1}}%  replacement format for bibliography title
  192.     \def\sameauthorrulesize##1{\global\bi*r={##1}}%
  193.     #1}}%
  194. \let\bif=\bibliographyformat
  195. %
  196. \def\bibtitle{}
  197. \def\bibliography#1{% calls bibtitle format and passes title
  198.     \global\bi*n=0                   % set bib counter to zero each call
  199.     \global\def\bibtitle{#1}         % collect title tokens
  200.     \par
  201.    {\the\bi*t}
  202.     \if*TC*bib \putincontents1{\the\*btf}\fi % call bib title format
  203.     \ignorespaces}% end bibliography markup
  204. \let\bib=\bibliography
  205. %
  206. \def\bibnumber{\the\bi*n}%
  207. \def\bibentry{\par\global\advance\bi*n by1\the\bi*f}%
  208. \let\bie=\bibentry                   % abbreviation for \bibentry
  209. %
  210. \def\sameauthor{\vrule\the\bi*r}%
  211. \let\sau=\sameauthor
  212. %
  213. \def\underscore#1{$\underline{\smash{\hbox{#1}}}$}%
  214. \let\us=\underscore
  215. \def\leader{\leaders\hbox to 8pt{\hss.\hss}\hfill}%
  216. %
  217. \def\hyphenoff{\pretolerance=10000\hbadness=10000}%
  218. \let\hof=\hyphenoff
  219. \def\hyphenon{\pretolerance=100\hbadness=1000}%
  220. \let\hon=\hyphenon
  221. %
  222. \def\today{\ifcase\month\or
  223.    January\or February\or March\or April\or May\or June\or
  224.    July\or August\or September\or October\or November\or December\fi
  225.    \space\number\day,\space\number\year}%
  226. %
  227. %
  228. \def\tilde{\relax\ifmmode\mathaccent"707E % relax added to trigger math
  229.              \else{\sy\char'030}\fi}%       mode in tabs 1/27/87
  230. %
  231. \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em}}%
  232. %
  233. \def\}{\relax\ifmmode \rbrace % relax added to trigger math mode in tabs
  234.           \else $\rbrace$\fi}%
  235. %
  236. \def\{{\relax\ifmmode \lbrace % relax added to trigger math mode in tabs
  237.           \else $\lbrace$\fi}%
  238. %
  239. \def\\{\relax\ifmmode \delimiter"26E30F % relax added to trigger math
  240.           \else $\delimiter"26E30F$\fi}%  mode in tabs
  241. %
  242. \let\leftsquarebracket=[
  243. \let\rightsquarebracket=]
  244. \let\lsb=[
  245. \let\rsb=]
  246. \def\~#1{{\relax\ifmmode\mathaccent"707E % relax added to trigger math
  247.              \else \accent"7E #1\fi}}%     mode in tabs
  248. %
  249. % baselineskip = interlineskip
  250. %
  251. \newskip\*isk
  252. \newskip\baseline
  253. \let\bl=\baseline
  254. \def\interlineskip#1{\baselineskip=#1%
  255.                      \baseline=#1%
  256.                      \*isk=#1\relax}%
  257. \let\isk=\interlineskip
  258. %
  259. \newfam\bifam   \newfam\ccfam
  260. %
  261. %   The \selectfontset macros are by JKW
  262. %
  263. \newtoks\naMEtok
  264. \newtoks\maTHtok
  265. \newskip\bAseSkip
  266. \def\selectfontset#1#2#3{\naMEtok={#2}
  267.    \edef\T{default}%
  268.    \edef\U{#3}%
  269.    \ifx\U\T \bAseSkip=0pt
  270.       \else \bAseSkip=#3\fi
  271.    \input #1.txt }%
  272. \let\sfs=\selectfontset
  273. \sfs{cm12}{twelvept}{default}
  274. \sfs{cm10}{tenpt}{default}
  275. \twelvept
  276. %
  277. \def\selectmathset#1#2{\maTHtok={#2}\input #1.mth}%
  278. \let\sms=\selectmathset
  279. \selectmathset{cm97m}{mathdefault} %
  280. \mathdefault
  281. %
  282. %  SELECT SPECIFIC FONT, jkw 8/26/86
  283. \newread\ckfnt
  284. \newif\ifnotcfend
  285. \newtoks\nUMtok
  286. \newtoks\nmtok
  287. \def\selectspecificfont#1#2#3{\naMEtok={#1}\nUMtok={#3}
  288.     \nmtok={#1\romannumeral #2}
  289.     \def\T{\uppercase{#1 }}%
  290.     \expandafter\xdef\csname I\the\nmtok\endcsname{\isk{\the\nUMtok}}
  291. %   \openin\ckfnt=cgfonts.lclist
  292. %      \loop\read\ckfnt to \W
  293. %      \edef\U{\uppercase{\W}}%
  294. %          \ifx\U\T
  295. %              \expandafter\font\csname F\the\nmtok%
  296. %                 \endcsname=#1 at #2 pt \notcfendfalse
  297. %          \else\ifeof\ckfnt
  298.                \expandafter\font\csname F\the\nmtok%
  299.                  \endcsname=#1#2  %\notcfendfalse
  300. %           \else\notcfendtrue\fi\fi
  301. %    \ifnotcfend           \repeat
  302. %   \closein\ckfnt
  303.     \expandafter\xdef\csname\the\naMEtok\endcsname ##1;{%
  304.                 \noexpand\csname F\the\naMEtok
  305.                 \noexpand\romannumeral\noexpand ##1\noexpand\endcsname
  306.                 \noexpand\csname I\the\naMEtok
  307.                 \noexpand\romannumeral\noexpand ##1\noexpand\endcsname}}%
  308. \let\ssf=\selectspecificfont
  309. %
  310. \skewchar\teni='177 \skewchar\seveni='177 \skewchar\fivei='177
  311. \skewchar\tensy='60 \skewchar\sevensy='60 \skewchar\fivesy='60
  312. %
  313. \setbox0=\hbox{\tenex B} \p@renwd=\wd0 % width of the big left (
  314. %
  315. %
  316. \newif\if*msp   \*mspfalse
  317. \def\monospace{%
  318.   \global\*msptrue                   % changed to global 6/27/86 bth
  319.   \sfs{monofont}{defaultmono}{default}
  320.   \defaultmono
  321.   \gdef\underscore##1{{\italicfont ##1}}%
  322.   \global\let\us=\underscore
  323.   \special{fonts=10cpi}
  324.   \raggedbottom
  325.   \global\paragraphskip{0pt}
  326.   \global\paragraphindent{36pt}
  327.   \gdef\tilde{\ifmmode\mathaccent"707E%
  328.                \else \char'176{}\fi}%
  329.   \gdef\_{\char'137{}}%
  330.   \gdef\}{\ifmmode \rbrace
  331.           \else \char'175{}\fi}%
  332.   \gdef\{{\ifmmode \lbrace
  333.           \else\char'173{}\fi}%
  334.   \gdef\\{\ifmmode \delimiter"26E30F%
  335.           \else\char'134{}\fi}%
  336.   \gdef\neg{\char'136{}}%
  337.   \gdef\ellipsis##1{{\def\U{\message{<TEXT1> Error! Only 3 or 4 are valid for ellipsis. Command ignored.}}
  338.     \ifcase ##1\U\or\U\or\U%
  339.       \or .~.~.
  340.       \or .~.~.~.
  341.       \else\U\fi}}%
  342.  
  343.   \tableofcontentsformat{% added 1/26/87 Guenther
  344.      \toctitle{\centerline{\bd Table of Contents}
  345.                \vs{1\bl}}
  346.      \figuretoctitle{\newpage
  347.                      \centerline{\bd List of Figures}
  348.                      \line{Figure \rt{Page}}}
  349.      \tabletoctitle{\newpage
  350.                     \centerline{\bd List of Tables}
  351.                     \line{Table \rt{Page}}}
  352.      }% end table of contents format
  353.  
  354.   \global\let\el=\ellipsis
  355.   \asisformat{\skipbefore{1\bl}\everyasis{\leftindent{0pt}}\skipafter{1\bl}}
  356.   \blockquoteformat{\skipbefore{1\bl}\everyblockquote{\rm\leftindent{36pt}\rightindent{36pt}}\skipafter{1\bl}}
  357.   \figureformat{\titleformat{\bqb\bd\hp Figure \figurenumber. \figuretitle \bqe}}
  358.   \tableformat{\titleformat{\vs{\bl}\cl{\bd Table \tablenumber}
  359.                   \cl{\rm\tabletitle}\vs{\bl}}}
  360.   \endnoteformat{\skipbefore{0\bl}\notereferencefont{\rm}\everyendnote{\rm\lin{0pt}}}
  361.   \footnoteformat{\textreferenceposition{down}\textreferencefont{\rm}\textreferencestyle{(1)}
  362.                   \notereferencefont{\rm}\everyfootnote{\rm\pin{.5in}\psk{.5in}\lin{0pt}\rin{0pt}}}
  363.  
  364.    \partformat{\titleformat{\dumpinsertseject\titlepage
  365.                    \hrule height0pt depth0pt \vfil
  366.                    \cl{\bd Part \partnumber}\cl{\bd\parttitle}\np
  367.                    \scn{0}\ssan{0}\ssbn{0}\sscn{0}\ssdn{0}
  368.                    \sfn{0}\stn{0}\sfnn{0}\senn{0}}}% end part format
  369.    \indexformat1{\everyindex{\rm}}
  370.    \indexformat2{\everyindex{\rm}}
  371.    \indexformat3{\everyindex{\rm}}
  372.    \chapterformat{\titleformat{\dumpinsertseject\cl{\bd Chapter \chapternumber}\cl{\bd\chaptertitle}\vs{1\bl}
  373.       \ssan{0}\ssbn{0}\sscn{0}\ssdn{0}}}% end chapter format
  374.    \prefaceformat{\titleformat{\dumpinsertseject\cl{\bd\prefacetitle}
  375.       \vs{1\bl}\ssan{0}\ssbn{0}\sscn{0}\ssdn{0}}}% end preface format
  376.    \appendixformat{\titleformat{\dumpinsertseject
  377.       \cl{\bd Appendix \appendixnumber}\cl{\bd\appendixtitle}\vs{1\bl}
  378.       \scn{0}\ssan{0}\ssbn{0}\sscn{0}\ssdn{0}\sfn{0}\stn{0}}}% end appendix format
  379.    \subheadaformat{\titleformat{\removelastskip\goodbreak\vs{2\bl}
  380.       \bd\nin\subheadatitle\par\nobreak\vs{1\bl}\nobreak
  381.       \ssbn{0}\sscn{0}\ssdn{0}}}% end subheadaformat markup
  382.    \subheadbformat{\titleformat{\removelastskip\goodbreak\vs{2\bl}
  383.       \it\nin\subheadbtitle\par\nobreak\vs{1\bl}\nobreak
  384.       \sscn{0}\ssdn{0}}}% end subheadbformat markup
  385.    \subheadcformat{\titleformat{\removelastskip\goodbreak\vs{2\bl}
  386.       \nin\subheadctitle\par\nobreak\vs{1\bl}\nobreak\ssdn{0}}}% end subheadc format markup
  387.    \subheaddformat{\titleformat{\goodbreak{\it \subheaddtitle.}}}% end subheadd markup
  388.    \runningheadformat{\bothpages{\line{\rm\lft{}\ctr{}\rt{\pagenumber}}
  389.       \vs{1\bl}}}% end runningheadformat markup
  390. }% END monospace markup definition
  391. \let\msp=\monospace
  392. %
  393. \def\sl{\message{<TEXT1> Warning! The slanted font is not in font sets. Only tensl is used.}\tensl}%
  394. %
  395. %    Ellipsis command 10/22/85
  396. %
  397. \def\ellipsis#1{{\def\U{\message{<TEXT1> Error! Only 3 or 4 are valid for ellipsis. Command ignored.}}
  398.    \ifcase #1\U\or\U\or\U%
  399.       \or \ifmmode\mathinner{\ldotp\ldotp\ldotp}
  400.             \else$\mathinner{\ldotp\ldotp\ldotp}$\fi
  401.       \or \ifmmode\mathinner{\ldotp\ldotp\ldotp\ldotp}
  402.             \else\removelastskip$\ldotp\ldotp\ldotp\ldotp$\fi
  403.       \else\U\fi}}%
  404. \let\el=\ellipsis
  405. %
  406. %    dumpinsertseject is plain.tex \dosupereject with and \else added
  407. %
  408. \def\dumpinsertseject{\ifnum\insertpenalties>\z@ % something is being held over
  409.                            \line{}\kern-\topskip\nobreak\vfill\supereject
  410.                          \else \newpage
  411.                          \fi}% END dumpinsertseject markup definition
  412. \let\die=\dumpinsertseject
  413. %
  414. \newif\if*tempif
  415. %
  416. %    Pageformat command
  417. %
  418. \newdimen\pg*l       \pg*l=11in      % page length
  419. \newdimen\pg*t       \pg*t=0in       % top margin set for 1in origin
  420. \newdimen\pg*b       \pg*b=2in       % bottom margin set for 1in origin
  421. \newdimen\pg*w       \pg*w=8.5in     % page width
  422. \newdimen\pg*r       \pg*r=2in       % right margin set for 1in,
  423. \newdimen\*lmar      \*lmar=0.2in    % left margin set for 1in
  424. %                                      Note: TEX origin at 1in,1in
  425. \newdimen\pg*a       \pg*a=0in
  426. \hsize=6.3in         \hoffset=0.2in
  427. \vsize=9in           \voffset=0in
  428. %
  429. \def\pageformat#1{{\par
  430.     \def\pagelength##1{\global\pg*l=##1
  431.                        \cpt*vs}%
  432.     \def\topmargin##1{\global\pg*t=##1
  433.                       \global\advance\pg*t by- 1in   % set margin 1in,1in
  434.                       \cpt*vs}%
  435.     \def\bottommargin##1{\global\pg*b=##1
  436.                       \global\advance\pg*b by 1in    % set margin 1in,1in
  437.                       \cpt*vs}%
  438.     \def\pagewidth##1{\global\pg*w=##1\cpt*hs}%
  439.     \def\rightmargin##1{\global\pg*r=##1
  440.                         \global\advance\pg*r by 1in  % set margin 1in,1in
  441.                         \cpt*hs}%
  442.     \def\leftmargin##1{\global\*lmar=##1
  443.                        \global\advance\*lmar by -1in % set margin 1in,1in
  444.                        \cpt*hs}%
  445.     \def\bindingadjust##1{\global\pg*a=##1\cpt*hs}%
  446.     \def\galleywidth##1{\global\pg*w=##1 \global\advance\pg*w by\*lmar
  447.                        \global\advance\pg*w by\pg*r \cpt*hs}%
  448.  #1}}% End pageformat markup definition
  449. \let\pf=\pageformat
  450. %
  451. % set page text size, compute hsize
  452. %
  453. \def\cpt*hs{% COMPUTE HORIZONTAL SIZE
  454.     \global\hoffset=\*lmar
  455.     \global\hsize=\pg*w              % added global 11/11/86 bth
  456.     \global\advance\hsize by-\pg*r   % ""
  457.     \global\advance\hsize by-\*lmar  % ""
  458.     \global\*txtw=\hsize}%             added for multi column routines
  459. %
  460. % set page text size, vsize
  461. %
  462. \def\cpt*vs{% COMPUTE VERTICAL SIZE
  463.     \global\voffset=\pg*t
  464.     \global\vsize=\pg*l
  465.     \global\advance\vsize by-\pg*t
  466.     \global\advance\vsize by-\pg*b
  467.     \if*title \global\advance \voffset by \tp*sk % lines from titlepage
  468.               \global\advance \vsize by -\tp*sk % from titlepage
  469.     \fi
  470.     \global\*txth=\vsize}%             added for multi column routines
  471. %
  472. %   left center right
  473. %
  474. \def\lft#1{#1\hfill}
  475. \def\ctr#1{\hfill #1\hfill}
  476. \def\rt#1{\hfill #1}
  477. %
  478. %  Page numbers
  479. %
  480. \def\setpagenumber#1{\global\pageno=#1}%
  481. \let\spn=\setpagenumber
  482. \def\pagenumber{\ifnum \pageno<0 \romannumeral-\pageno
  483.                        \else \number\pageno\fi}%
  484. \let\pn=\pagenumber
  485. %
  486. \def\rule{\vskip 1\baselineskip\hrule}%
  487. %
  488. %  Running heads
  489. %
  490. \newif\if*title
  491. %
  492. \newtoks\rh*r     \rh*r={\line{\twelvept\rt{\pagenumber}}\vs{\bl}}
  493. \newtoks\rh*l     \rh*l={\line{\twelvept\rt{\pagenumber}}\vs{\bl}}
  494. \newtoks\rf*r     \rf*r={}
  495. \newtoks\rf*l     \rf*l={}
  496. %
  497. \def\runningheadformat#1{{%
  498.     \def\*ttitle##1{\setbox\A=\vbox{##1}%
  499.                     \D=\ht\A
  500.                     \advance\D by -1in
  501.                     \ifdim \D>\pg*t
  502.                            \global\pg*t=\D
  503.                            \global\advance\pg*t by 12pt
  504.                            \advance\D by 1in
  505.                            \message{<TEXT1> Warning, the top margin you
  506.                                   have specified is less than the
  507.                                   running top title. The top margin will
  508.                                   be changed to \the\D}
  509.                            \cpt*vs
  510.                     \fi
  511.                     \if*tempif \global\rh*l={\hrule width\hsize
  512.                                              height0pt depth0pt ##1}
  513.                     \else \global\rh*r={\hrule width\hsize
  514.                                         height0pt depth0pt ##1}\fi
  515.                    }% end *ttitle definition
  516.     \def\evenpages##1{\*tempiftrue\*ttitle{##1}}%
  517.     \def\oddpages##1{\*tempiffalse\*ttitle{##1}}%
  518.     \def\bothpages##1{\*tempiftrue\*ttitle{##1}
  519.                       \*tempiffalse\*ttitle{##1}}%
  520.     \relax
  521.  #1
  522.  }}% END runningheadformat markup definition
  523. \let \rhf = \runningheadformat
  524. %
  525. \def\runningfootformat#1{{%
  526.     \def\*btitle##1{\setbox\A=\vbox{##1}%
  527.                     \D=\ht\A
  528.                     \advance\D by 1in
  529.                     \ifdim \D>\pg*b
  530.                            \global\pg*b=\D
  531.                            \global\advance\pg*b by 12pt
  532.                            \advance\D by -1in
  533.                            \message{<TEXT1> Warning, the bottom  margin
  534.                            you have specified is less than height of the
  535.                            running bottom title.
  536.                            The bottom margin will be
  537.                            changed to \the\D}
  538.                            \cpt*vs
  539.                     \fi
  540.                     \if*tempif \global\rf*l={##1}
  541.                          \else \global\rf*r={##1}\fi
  542.                 }% end of bottomline
  543.     \def\evenpages##1{\*tempiftrue\*btitle{##1}}%
  544.     \def\oddpages##1{\*tempiffalse\*btitle{##1}}%
  545.     \def\bothpages##1{\*tempiftrue\*btitle{##1}
  546.                       \*tempiffalse\*btitle{##1}}%
  547.     \relax
  548.  #1}}% END runningfootformat markup definition
  549. \let \rff = \runningfootformat
  550. %
  551. \newdimen\tp*sk       \tp*sk=1in
  552. \newtoks\tp*fl      \tp*fl={}
  553. \def\titlepageformat#1{{%
  554.     \def\titleleadskip##1{\global\tp*sk=##1}%
  555.     \def\titlefootline##1{\global\tp*fl={##1}}%
  556.     \relax
  557.     #1
  558.     \titlepage}} %end of titlepageformat
  559. \let \tpf = \titlepageformat
  560. %
  561. \def\titlepage{\global\*titletrue
  562.                \cpt*vs}%
  563. \let\tp=\titlepage
  564. \def\notitlepage{\global\*titlefalse
  565.                  \cpt*vs}%
  566. \let\ntp=\notitlepage
  567. %
  568. %
  569. %   Output changed to permit binding adjust
  570. %
  571. \output={\*mkpg}
  572. %
  573. \def\*mkpg{\*badj
  574.            \plainoutput
  575.            \if*title \notitlepage\fi
  576.            \ifnum\*pcount>0 \*blkpg\fi}% insert blank page
  577. %
  578. \def\makeheadline{% headline set for multiple and single column modes
  579.     \if*title%  Do nothing if its a title page
  580.     \else \setbox\A=\vbox{\hsize=\the\*txtw % hsize added to allow
  581.     \ifodd\pageno\the\rh*r %                 headline to print the
  582.     \else\the\rh*l\fi} %                     full width in multi
  583.     \vbox to 0pt{\vskip-\ht\A\box\A\vss} %   column mode
  584.     \fi} % This could replace the TEXT1@@ definition
  585. %
  586. \def\makefootline{\if*title \vbox to 0pt{\hsize=\the\*txtw\the\tp*fl\vss}
  587.            \else\vbox to 0pt{\hsize=\the\*txtw\ifodd\pageno\the\rf*r
  588.            \else\the\rf*l\fi\vss} % hsize added for multi column mode
  589.            \fi} % This could replace the TEXT1@@ definition
  590. %
  591. \def\*badj{\ifdim\pg*a=\z@ % do nothing if binding adjust absent
  592.            \else
  593.               \ifodd\pageno % Binding adjust markup (revised 2/03/87
  594.                 \global\hoffset=\*lmar % offset equals left margin value
  595.                 \global\advance\hoffset by\pg*a % plus binding adjust
  596.              \else
  597.                 \global\hoffset=\*lmar % offset equals left margin value
  598.                 \global\advance\hoffset by-\pg*a % plus binding adjust
  599.           \fi\fi}% end binding adjust markup
  600. %
  601. %     linebreak
  602. %
  603. \def\linebreak{\null\hfil\break}
  604. \let\lbr=\linebreak
  605. \let\toclinebreak=\linebreak
  606. \let\toclbr=\linebreak
  607. %
  608. %  Horizontal skip
  609. %
  610. \def\horizontalspace#1{\null\hskip#1\relax}%
  611. \let\hs=\horizontalspace
  612. %
  613. % skip down
  614. %
  615. \def\verticalspace#1{\vskip #1\relax}%
  616. \let\vs=\verticalspace
  617. %
  618. \def\verticalspacekeep#1{\par
  619.                         \hbox{\vbox{\vskip #1\relax}}}%
  620. \let\vsk=\verticalspacekeep
  621. %
  622. %    raggedright (as TeX basic)
  623. %
  624. \newdimen\r*sk       \r*sk=0pt       % dimension to save right skip
  625. \def\rightragged{\par \r*sk=\rightskip   \*rrtrue
  626.     \if*msp \rightskip=\r*sk plus10em
  627.             \spaceskip=1em \xspaceskip=1em
  628.     \else  \rightskip=\r*sk plus2em\relax
  629.            \spaceskip=.3333em \xspaceskip=.5em
  630.            \fi}
  631. \let\rr=\rightragged
  632. %
  633. %    leftragged
  634. %
  635. \newdimen\l*sk    \l*sk=0pt          % dimension to save left skip
  636. \def\leftragged{\par %
  637.     \l*sk=\leftskip
  638.     \spaceskip=.35em
  639.     \xspaceskip=.55em
  640.     \parfillskip=0pt
  641.     \leftskip=\l*sk plus2em\relax}
  642. \let\lr=\leftragged
  643. %
  644. \newif\if*rr   \*rrfalse
  645. \def\justify{\par
  646.              \rightskip=\r*sk
  647.              \*rrfalse
  648.              \leftskip=\l*sk
  649.              \spaceskip=0pt \xspaceskip=0pt
  650.              \parfillskip=0pt plus1fil\relax}
  651. \let\ju=\justify
  652. %
  653. %    spacing
  654. %
  655. \def\singlespace{\par\baselineskip=\*isk}
  656. \let\ssp=\singlespace
  657. \def\doublespace{\par\baselineskip=2\*isk}
  658. \let\dsp=\doublespace
  659. %
  660. %     paragraph
  661. %
  662. \let\paragraph=\par
  663. \def\paragraphindent#1{\parindent=#1}
  664. \let\pin=\paragraphindent
  665. \def\paragraphskip#1{\parskip=#1}
  666. \let\psk=\paragraphskip
  667. %
  668. %  noindent
  669. %
  670. \let\nin=\noindent
  671. %
  672. %  hanging paragraph macro
  673. %
  674. \newdimen\*hin          \*hin=24pt
  675. \def\hangingindent#1{\*hin=#1}
  676. \let\hin=\hangingindent
  677. %
  678. \def\hangingparagraph{\par
  679.                       \hangindent=\*hin
  680.                       \hangafter=1
  681.                       \noindent}
  682. \let\hp=\hangingparagraph
  683. \newif\if*mnr     \*mnrfalse        % left/right margin note indicator
  684. \newtoks\e*mn     \e*mn={\tenpt\rr} % every margin note tokens
  685. \newtoks\*mnw     \*mnw={54pt}      % margin note width tokens
  686. \newtoks\*mngut   \*mngut={6pt}     % margin note gutter tokens
  687. %
  688. %           Margin Note markup
  689. %
  690. \def\marginnoteformat#1{% MARGINAL NOTE FORMAT
  691.     \def\position##1{% "left" or "right" margin note check
  692.        \edef\T{##1}%
  693.        \edef\U{left}%
  694.        \edef\V{right}%
  695.        \ifx \T\U \global\*mnrfalse   % left margin notes true
  696.        \else\ifx \T\V \global\*mnrtrue % right margin notes true
  697.             \else\global\*mnrfalse   % default, improper entry
  698.                \write16{<TEXT1> You must specify "left" or "right" in %
  699.                       the marginnoteformat markup. Left is the default.}%
  700.        \fi\fi}% end margin note check
  701.     \def\notewidth##1{\global\*mnw={##1}}% note width variable
  702.     \def\notegutter##1{\global\*mngut={##1}}% gutter width variable
  703.     \def\everymarginnote##1{\global\e*mn={##1}}% token variable
  704.     #1}% insert arguments, END marginnoteformat
  705. \let\mnf=\marginnoteformat           % set marginnoteformat abbreviation
  706. %
  707. \long\def\marginnote#1{% BEGIN MARGIN NOTE MACRO
  708.     \special{MARGINNOTE=true} % added 6/30/87 jkw for 8600 line numbering
  709.     \ifvmode\leavevmode\fi           % can't use vadjust in vertical mode
  710.     \bgroup                          % begin margin note routine
  711.     \def\rightragged{\r*sk=\rightskip   \*rrtrue
  712.         \if*msp \rightskip=\r*sk plus10em %
  713.            \spaceskip=1em \xspaceskip=1em %
  714.         \else \advance\rightskip by 0pt plus1fil\relax %
  715.            \spaceskip=.35em \xspaceskip=.55em %
  716.         \fi}% par removed from TEXT1 version %
  717.     \let\rr=\rightragged             %
  718. %
  719.     \tolerance=6000                  % increase line-breaking tolerance
  720.     \hbadness=6000                   % increase warning tolerance
  721.     \strut                           % sets line depth for vadjust
  722.     \D=\dp\strutbox                  % capture depth of current line
  723.     \the\e*mn                        % every margin note tokens
  724.     \strut                           % sets strut to margin note font
  725.     \parskip=0pt                     % cancel any paragraph skip
  726.     \if*mnr                          % right margin notes true
  727.        \vadjust{                     % make whats'it in text
  728.        \rlap{\smash{                 % rightlap, make note depth zero
  729.        \hskip\hsize                  % skip to right margin
  730.        \hskip\the\*mngut             % make gutter
  731.        \vtop{\hsize=\the\*mnw        % set reference point, new hsize
  732.        \kern-\D                      % kern depth of current text line
  733.        \kern-\ht\strutbox            % kern height of margin note text
  734.        \nin#1}}}}%                   % input margin note text
  735.     \else                            % left margin notes true
  736.        \vadjust{                     % make whats'it in text
  737.           \llap{\smash{              % leftlap, make note depth zero
  738.           \vtop{\hsize=\the\*mnw     % gather vertical material with
  739.           \kern-\D                   % kern depth of current text line
  740.           \kern-\ht\strutbox         % kern height of margin note text
  741.           \nin#1}%                     reference point at the top
  742.           \hskip\the\*mngut}}}%        make margin note gutter
  743.     \fi                              %
  744.     \egroup                          % end margin notes routine
  745.     \ignorespaces}% END margin note macro
  746. \let\mn=\marginnote
  747. %
  748. %
  749. % labeled definition macro
  750. %
  751. \newdimen\la*w   \la*w=1in         % Label width
  752. \newtoks\la*g    \la*g={1em}       % Label gutter
  753. \newtoks\la*s    \la*s={1\bl}      % Skip before label
  754. \newtoks\la*f    \la*f={\rm}       % Label font
  755. %
  756. \long\def\label#1{\par\vskip\the\la*s
  757.              \setbox\A=\vtop{\hsize=\la*w
  758.                                   \leftskip=0pt
  759.                                   \rightskip=0pt plus2em
  760.                                   \tolerance=1600
  761.                                   \noindent
  762.                                   \the\la*f
  763.                                   #1}%
  764.              \hangindent=\la*w
  765.              \advance \hangindent by \the\la*g
  766.              \hangafter=1
  767.              \noindent
  768.              \setbox0=\hbox{\rlap{\box\A}}\ht0=0pt\dp0=0pt\box0%
  769.              \hskip\la*w
  770.              \hskip\the\la*g
  771.              \ignorespaces}
  772. \let\la=\label
  773. %
  774. \def\labelformat#1{{\def\skipbefore##1{\global\la*s={##1}}%
  775.       \def\labelwidth##1{\global\la*w=##1}%
  776.       \def\gutter##1{\global\la*g={##1}}%
  777.       \def\everylabel##1{\global\la*f={##1}}%
  778.       #1}}% End labelformat
  779. \let\laf=\labelformat
  780. %
  781. %     leftindent
  782. %
  783. \newif\if*ok
  784. \newif\if*zero
  785. \def\leftindent#1{\par
  786.                   \*zerofalse
  787.                   \*okfalse
  788.                   \e*p#1\end%
  789.                   \if*zero \leftskip 0pt \fi
  790.                   \advance \leftskip by #1
  791.                   \l*sk=\leftskip   % l*sk used in justify reset
  792.                   }%
  793. \let\lin=\leftindent
  794. %
  795. \def\rightindent#1{\par
  796.                    \*zerofalse  \*okfalse
  797.                    \e*p#1\end%
  798.                    \if*zero \rightskip 0pt \fi
  799.                    \advance \rightskip by #1
  800.                    \if*rr\rr\fi
  801.                    \r*sk=\rightskip}% r*sk used in justify reset
  802. \let\rin=\rightindent
  803. %
  804. %  \e*p will determine if the parm value passed to \leftindent
  805. %  or \rightindent is to be relative to the previous indent, which means a
  806. %  "+" or "-" will appear in front of the indent value. If no "+" or "-",
  807. %  then the indent is to be absolute from the original left margin.
  808. %
  809. \def\e*p#1{\ifx #1\end \let \next = \relax%     e*p => Evaluate Parameter
  810.     \else \if*ok \let \next = \e*p
  811.         \else \global\*oktrue
  812.               \ifx #1+ \let \next = \e*p
  813.                    \else \ifx #1- \let \next = \e*p
  814.                          \else \*zerotrue
  815.                                \let \next = \e*p
  816.     \fi\fi\fi\fi \next}
  817. %
  818. %              Blockquote
  819. %
  820. \newskip\bq*sb   \bq*sb = 6pt     % Default skip before
  821. \newskip\bq*sa   \bq*sa = 6pt     % Default skip after
  822. \newtoks\bq*f    \bq*f={\tenpt\leftindent{24pt}\rightindent{24pt}}
  823. %
  824. \def\blockquoteformat#1{{%
  825.         \def\everyblockquote##1{\global\bq*f={##1}}%
  826.         \def\skipbefore##1{\global\bq*sb=##1\relax}%
  827.         \def\skipafter##1{\global\bq*sa=##1\relax}%
  828.         #1}} %end of blockquoteformat
  829. \let\bqf=\blockquoteformat
  830. %
  831. \def\blockquotebegin{\par\vskip\bq*sb\relax\begingroup
  832.                      \the\bq*f }
  833. \let\bqb=\blockquotebegin
  834. \def\blockquoteend{\par\endgroup\vskip\bq*sa\relax}
  835. \let\bqe=\blockquoteend
  836. %
  837. %
  838. %
  839. %
  840. %                            Footnote
  841. %
  842. %    The "tfn" prefixed values are for the reference in the text of
  843. %    the document.
  844. %
  845. \newif\if*tfn*dnum        \*tfn*dnumfalse    %"1." style
  846. \newif\if*tfn*unum        \*tfn*unumtrue     %"1" style
  847. \newif\if*tfn*pnum        \*tfn*pnumfalse    %"(1)" style
  848. \newif\if*tfn*dlet        \*tfn*dletfalse    % "a." style
  849. \newif\if*tfn*ulet        \*tfn*uletfalse    % "a"  style
  850. \newif\if*tfn*plet        \*tfn*pletfalse    % "(a)" style
  851. \newif\if*tfn*rbe         \*tfn*rbefalse     % reference after word
  852. \newif\if*tfnupchar       \*tfnupchartrue    %
  853. \newtoks\*tfn*rfont       \*tfn*rfont={\tenpt\rm}
  854. %
  855. %    The "nfn" prefixed values are for the reference as it is formatted
  856. %    at the bottom of the page.
  857. %
  858. \newif\if*nfn*dnum        \*nfn*dnumtrue      %"1." style
  859. \newif\if*nfn*unum        \*nfn*unumfalse     %"1" style
  860. \newif\if*nfn*pnum        \*nfn*pnumfalse     %"(1)" style
  861. \newif\if*nfn*dlet        \*nfn*dletfalse     % "a." style
  862. \newif\if*nfn*ulet        \*nfn*uletfalse     % "a" style
  863. \newif\if*nfn*plet        \*nfn*pletfalse     % "(1)" style
  864. \newif\if*nfnupchar       \*nfnupcharfalse    % reference is not superscript
  865. \newtoks\*nfn*rfont       \*nfn*rfont={\tenpt\rm}
  866. \newtoks\*nfng            \*nfng={1em}
  867. %
  868. \newif\if*fn*llap         \*fn*llaptrue
  869. \newtoks\fn*f
  870. \newcount\fn*num
  871. \newdimen\fn*div    \fn*div=2in
  872. \newskip\fn*sadiv       \fn*sadiv=2.6pt  %default skip after divider
  873. \newskip\fn*sbdiv       \fn*sbdiv=6pt  %default skip before divider
  874. %
  875. \def\footnotenumber{{\if*tfn*dnum \the\fn*num      % "1." style
  876.                 \else\if*tfn*unum \the\fn*num      % "1" style
  877.                 \else\if*tfn*pnum \the\fn*num      % "(1)" style
  878.                 \else\l*alphatrue \a*c{\fn*num}    % "a.", "a", and "(a)"
  879.                   \fi\fi\fi
  880.                   \removelastskip}}
  881. %
  882. \def\setfootnotenumber#1{\fn*num=#1}
  883. \let\sfnn=\setfootnotenumber
  884. %
  885. \skip\footins=15pt plus 3pt minus 2pt
  886. \fn*f={\tenpt\pin{20pt}\lin{0in}}
  887. %
  888. \def\footnoteformat#1{{%
  889.   \def\everyfootnote##1{\global\fn*f{##1}}%
  890.   \def\textreferencestyle##1{%
  891.              \global\*tfn*dnumfalse
  892.              \global\*tfn*unumfalse
  893.              \global\*tfn*pnumfalse
  894.              \global\*tfn*dletfalse
  895.              \global\*tfn*uletfalse
  896.              \global\*tfn*pletfalse
  897.              \edef\T{##1}%
  898.              \edef\U{(1)}%
  899.              \edef\V{1}%
  900.              \edef\Y{1.}%
  901.              \edef\W{(a)}%
  902.              \edef\X{a}%
  903.              \edef\Z{a.}%
  904.              \ifx\T\U \global\*tfn*pnumtrue
  905.                  \else\ifx\T\V \global\*tfn*unumtrue
  906.                  \else\ifx\T\Y \global\*tfn*dnumtrue
  907.                  \else\ifx\T\W \global\*tfn*plettrue
  908.                  \else\ifx\T\X \global\*tfn*ulettrue
  909.                  \else\ifx\T\Z \global\*tfn*dlettrue
  910.                  \else \message{<TEXT1> Error! textreferencestyle ##1
  911.                              is not a valid style. Statement ignored.}
  912.        \fi\fi\fi\fi\fi\fi}%   end reference style
  913.    \def\textreferencefont##1{\global\*tfn*rfont{##1}}%
  914.    \def\textreferenceplacement##1{\global\*tfn*rbefalse
  915.                        \edef\T{##1}%
  916.                        \edef\U{before}%
  917.                        \edef\V{after}%
  918.        \ifx\T\U \global\*tfn*rbetrue
  919.            \else\ifx\T\V \global\*tfn*rbefalse
  920.            \else \message{<TEXT1> Error! textreferenceplacement ##1
  921.                           is invalid. Statement ignored.}
  922.        \fi\fi}
  923.    \def\textreferenceposition##1{\global\*tfnupcharfalse
  924.                        \edef\T{##1}%
  925.                        \edef\U{up}%
  926.                        \edef\V{down}%
  927.        \ifx\T\U \global\*tfnupchartrue
  928.            \else\ifx\T\V \global\*tfnupcharfalse
  929.            \else \message{<TEXT1> Error! textreferenceposition ##1
  930.                           has an invalid parameter. Statement ignored.}
  931.        \fi\fi}
  932.   \def\notereferencestyle##1{
  933.              \global\*nfn*dnumfalse
  934.              \global\*nfn*unumfalse
  935.              \global\*nfn*pnumfalse
  936.              \global\*nfn*dletfalse
  937.              \global\*nfn*uletfalse
  938.              \global\*nfn*pletfalse
  939.              \edef\T{##1}%
  940.              \edef\U{(1)}%
  941.              \edef\V{1}%
  942.              \edef\Y{1.}%
  943.              \edef\W{(a)}%
  944.              \edef\X{a}%
  945.              \edef\Z{a.}%
  946.              \ifx\T\Y \global\*nfn*dnumtrue
  947.                  \else\ifx\T\U \global\*nfn*pnumtrue
  948.                  \else\ifx\T\V \global\*nfn*unumtrue
  949.                  \else\ifx\T\W \global\*nfn*plettrue
  950.                  \else\ifx\T\X \global\*nfn*ulettrue
  951.                  \else\ifx\T\Z \global\*nfn*dlettrue
  952.                  \else \message{<TEXT1> Error! notereferencestyle ##1
  953.                              is not a valid style. Statement ignored.}
  954.         \fi\fi\fi\fi\fi\fi}%   end reference style
  955.    \def\notereferencefont##1{\global\*nfn*rfont{##1}}%
  956.    \def\notereferenceposition##1{\global\*nfnupcharfalse
  957.                        \edef\T{##1}%
  958.                        \edef\U{up}%
  959.                        \edef\V{down}%
  960.        \ifx\T\U \global\*nfnupchartrue
  961.            \else\ifx\T\V \global\*nfnupcharfalse
  962.            \else \message{<TEXT1> Error! notereferenceposition ##1
  963.                           has an invalid parameter. Statement ignored.}
  964.        \fi\fi}%
  965.    \def\skipbeforedivider##1{\global\fn*sbdiv=##1\relax}%
  966.    \def\footnotedivider##1{\global\fn*div=##1\relax}%
  967.    \def\notereferencegutter##1{\global\*nfng={##1}}%
  968.    \def\skipafterdivider##1{\global\fn*sadiv=##1\relax}%
  969.    #1
  970.    \relax
  971.    \skip\footins=0pt plus 3pt minus 2pt
  972.    \global\advance\skip\footins by \fn*sbdiv\relax%
  973.    \global\advance\skip\footins by \fn*sadiv\relax%
  974. }} % end of footnoteformat
  975. \let\fnf=\footnoteformat
  976. %
  977. \def\autofootnote{\global\advance\fn*num by 1
  978.     \l*alphatrue
  979.     \xdef\I{%
  980.           \if*tfn*unum \the\fn*num%
  981.           \else \if*tfn*ulet \a*c{\the\fn*num}%
  982.           \else \if*tfn*plet (\a*c{\the\fn*num})%
  983.           \else \if*tfn*pnum (\the\fn*num)%
  984.           \else \if*tfn*dlet \a*c{\the\fn*num}.%
  985.           \else \if*tfn*dnum \the\fn*num.%
  986.           \fi\fi\fi\fi\fi\fi}%
  987.     \def\K{%
  988.           \if*nfn*unum \the\fn*num%
  989.           \else \if*nfn*ulet \a*c{\the\fn*num}%
  990.           \else \if*nfn*plet (\a*c{\the\fn*num})%
  991.           \else \if*nfn*pnum (\the\fn*num)%
  992.           \else \if*nfn*dlet \a*c{\the\fn*num}.%
  993.           \else \if*nfn*dnum \the\fn*num.%
  994.           \fi\fi\fi\fi\fi\fi}%
  995. %
  996.     \let\@sf=\empty
  997.     \ifhmode\edef\@sf{\spacefactor=\the\spacefactor}\fi
  998.     \def\J{{\the\*tfn*rfont
  999.            \if*tfnupchar \raise.7ex\hbox{\the\*tfn*rfont\I}%
  1000.                         \else {\I}\fi}}%
  1001.     \if*tfn*rbe \@sf\J\ignorespaces%
  1002.               \else\unskip\unskip\unskip\unskip\J\@sf\fi
  1003.     \def\M{{\the\*nfn*rfont
  1004.            \if*nfnupchar \raise.7ex\hbox{\K}%
  1005.                         \else {\K}\fi}}%
  1006.   \vfootnote{\M}}
  1007. \let\afn=\autofootnote
  1008. %
  1009. %        vfootnote redefined to include fn*f features
  1010. %        The addition of hsize=txtw in vfootnote for flexibleformat allows the
  1011. %
  1012. %        footnote to print across the full text width at the page bottom.
  1013. %
  1014. %        Footstrut redefined to baselineskip for consistent spacing in footnote
  1015. %
  1016. %
  1017. \def\footnoterule{\vskip-\fn*sadiv\hrule width\fn*div\vskip\fn*sadiv\relax}
  1018. %
  1019. %          redefined from PLAIN TEX to baselineskip. PLAIN TEX
  1020. %          used the height of a ten point strutbox
  1021. %
  1022. \def\vfootnote#1{% Vfootnote revised 11/6/86
  1023.     \insert\footins\bgroup
  1024.     \if*fix %                          if fixed mode do nothing to footnote
  1025.     \else\hsize=\*txtw\fi %            else print footnote across full width of page
  1026.    \interlinepenalty\interfootnotelinepenalty
  1027.    \setbox\strutbox=\hbox{\vrule height 1.8ex depth .6ex width 0pt}%
  1028.    \splittopskip\ht\strutbox %          top baseline for broken footnotes
  1029.    \splitmaxdepth\dp\strutbox
  1030.    \floatingpenalty\@MM
  1031.    \leftskip\z@skip
  1032.    \rightskip\z@skip
  1033.    \spaceskip\z@skip
  1034.    \xspaceskip\z@skip
  1035.    \the\fn*f
  1036.    \def\T{\parindent}% For some odd and unknown reason this def is needed
  1037.    \ifdim\the\parindent>0pt \global\*fn*llaptrue
  1038.       \else \ifdim\the\leftskip>0pt \global\*fn*llaptrue
  1039.       \else \global\*fn*llapfalse\fi\fi
  1040.    \leavevmode
  1041.    \if*fn*llap  \hbox to 0pt{\hss{#1\hskip\the\*nfng}}%
  1042.       \else \hbox{#1\hskip\the\*nfng}\fi%
  1043.   \ignorespaces
  1044.   \footstrut\futurelet\next\fo@t}% END vfootnote markup definition
  1045. %
  1046. \def\footstrut{\vbox to\baselineskip{}}
  1047. %
  1048. %                            Endnote
  1049. %
  1050. %    The "ten" prefixed values are for the reference in the text of
  1051. %    the document.
  1052. %
  1053. \newif\if*ten*num        \*ten*numtrue      % "[1]", "1" and "(1)" styles
  1054. \newif\if*ten*let        \*ten*letfalse     % "a" and "(a)" styles
  1055. \newif\if*ten*paren      \*ten*parenfalse   % "(1)" and "(a)" styles
  1056. \newif\if*ten*sb         \*ten*sbtrue       % "[1]" style
  1057. \newif\if*tenupchar      \*tenupcharfalse   % reference is not superscripted by
  1058. \newtoks\*tenrfont       \*tenrfont={\tenpt\rm}
  1059. %
  1060. %    The "nen" prefixed values are for the reference as it is formatted
  1061. %    at the end of a chapter or the end of the document.
  1062. %
  1063. \newif\if*nen*num        \*nen*numtrue      % "[1]", "1", "1." and "(1)" styles
  1064. \newif\if*nen*let        \*nen*letfalse     % "a" and "(a)" styles
  1065. \newif\if*nenll*per      \*nenll*pertrue    % "1." style
  1066. \newif\if*nen*paren      \*nen*parenfalse   % "(1)" and "(a)" styles
  1067. \newif\if*nen*sb         \*nen*sbfalse      % "[1]" style
  1068. \newif\if*nenupchar      \*nenupcharfalse   % reference isn't superscripted
  1069. \newtoks\*nenrfont       \*nenrfont={\tenpt\rm}
  1070. \newdimen\*neng          \*neng=1em
  1071. %
  1072. \newtoks\*enpar
  1073. \newcount\en*n
  1074. \newskip\en*s            \en*s=4pt
  1075. %
  1076. %
  1077. \def\endnotenumber{{\if*ten*num \the\en*n      % all numeric styles
  1078.                 \else\l*alphatrue \a*c{\en*n}  % all alpha styles
  1079.                   \fi
  1080.                   \removelastskip}}
  1081. %
  1082. \def\setendnotenumber#1{\en*n=#1}
  1083. \let\senn=\setendnotenumber
  1084. %
  1085. \*enpar={\tenpt\pin{0in}\lin{1.2em}}
  1086. %
  1087. \def\endnoteformat#1{%
  1088.  {\def\everyendnote##1{\global\*enpar{##1}}%
  1089.   \def\textreferencestyle##1{%
  1090.              \global\*ten*numfalse
  1091.              \global\*ten*letfalse
  1092.              \global\*ten*parenfalse
  1093.              \global\*ten*sbfalse
  1094.              \edef\T{##1}%
  1095.              \edef\U{[1]}%
  1096.              \edef\V{(1)}%
  1097.              \edef\W{1}%
  1098.              \edef\X{(a)}%
  1099.              \edef\Y{a}%
  1100.              \ifx\T\U \global\*ten*numtrue \global\*ten*sbtrue              % st
  1101.                  \else\ifx\T\V \global\*ten*numtrue \global\*ten*parentrue  % st
  1102.                  \else\ifx\T\W \global\*ten*numtrue                         % st
  1103.                  \else\ifx\T\X \global\*ten*lettrue \global\*ten*parentrue  % st
  1104.                  \else\ifx\T\Y \global\*ten*lettrue                         % st
  1105.                  \else \message{<TEXT1> Error! textreferencestyle ##1
  1106.                              is not a valid style. Statement ignored.}
  1107.            \fi\fi\fi\fi\fi}%   end reference style
  1108.    \def\textreferencefont##1{\global\*tenrfont{##1}}%
  1109.    \def\textreferenceposition##1{\global\*tenupcharfalse
  1110.                        \edef\T{##1}%
  1111.                        \edef\U{up}%
  1112.                        \edef\V{down}%
  1113.        \ifx\T\U \global\*tenupchartrue
  1114.            \else\ifx\T\V \global\*tenupcharfalse
  1115.            \else \message{<TEXT1> Error! textreferenceposition ##1
  1116.                           has an invalid parameter. Statement ignored.}
  1117.        \fi\fi}
  1118.   \def\notereferencestyle##1{
  1119.              \global\*nen*numfalse
  1120.              \global\*nen*letfalse
  1121.              \global\*nen*parenfalse
  1122.              \global\*nenll*perfalse
  1123.              \global\*nen*sbfalse
  1124.              \edef\T{##1}%
  1125.              \edef\U{[1]}%
  1126.              \edef\V{(1)}%
  1127.              \edef\W{1}%
  1128.              \edef\X{(a)}%
  1129.              \edef\Y{a}%
  1130.              \edef\Z{1.}%
  1131.              \ifx\T\Z \global\*nen*numtrue \global\*nenll*pertrue        % style
  1132.                  \else\ifx\T\U \global\*nen*numtrue \global\*nen*sbtrue     % st
  1133.                  \else\ifx\T\V \global\*nen*numtrue \global\*nen*parentrue  % st
  1134.                  \else\ifx\T\W \global\*nen*numtrue                         % st
  1135.                  \else\ifx\T\X \global\*nen*lettrue \global\*nen*parentrue  % st
  1136.                  \else\ifx\T\Y \global\*nen*lettrue                         % st
  1137.                  \else \message{<TEXT1> Error! notereferencestyle ##1
  1138.                              is not a valid style. Statement ignored.}
  1139.            \fi\fi\fi\fi\fi\fi}%   end reference style
  1140.    \def\notereferencefont##1{\global\*nenrfont{##1}}%
  1141.    \def\notereferenceposition##1{\global\*nenupcharfalse
  1142.                        \edef\T{##1}%
  1143.                        \edef\U{up}%
  1144.                        \edef\V{down}%
  1145.        \ifx\T\U \global\*nenupchartrue
  1146.            \else\ifx\T\V \global\*nenupcharfalse
  1147.            \else \message{<TEXT1> Error! notereferenceposition ##1
  1148.                           has an invalid parameter. Statement ignored.}
  1149.        \fi\fi}%
  1150.    \def\notereferencegutter##1{\global\*neng=##1}%
  1151.    \def\skipbefore##1{\global\en*s=##1}%
  1152.    \relax
  1153.    #1}} % end of footnoteformat
  1154. \let\enf=\endnoteformat
  1155. %
  1156. \newlinechar=`\^^J
  1157. \newhelp\aenhelp{relax
  1158.    You may continue if you wish, but I'd be surprised
  1159.    if your job^^J
  1160.    finished without any errors when you print the endnotes. }
  1161. %
  1162. \def\err@#1{\errmessage{TEXT1 error: #1}}
  1163. \def\*aenerr{\errhelp=\aenhelp
  1164.     \catcode`@=11
  1165.     \errmessage{Results are unpredictable
  1166.                  when you use autoendnote with asisbegin.
  1167.                  Type h for more help}}%
  1168. \def\autoendnote{\global\advance\en*n by 1
  1169.     \if*aib \*aenerr \fi
  1170.     \l*alphatrue
  1171.     \edef\I{%
  1172.           \if*ten*paren (\unskip\fi
  1173.           \if*ten*sb [\unskip\fi
  1174.           \if*ten*num \the\en*n\fi
  1175.           \if*ten*let \a*c{\the\en*n}\fi
  1176.           \if*ten*paren \unskip)\fi
  1177.           \if*ten*sb \unskip]\fi}%
  1178.   \let\@sf=\empty
  1179.   \ifhmode \edef\@sf{\spacefactor=\the\spacefactor}%
  1180.      \else \let\@sf=\empty\fi
  1181.   \unskip\unskip
  1182.   \if*tenupchar \raise.7ex\hbox{\the\*tenrfont\I}\@sf%
  1183.           \else {\the\*tenrfont\I}\@sf\fi%
  1184.     \edef\J{%
  1185.           \if*nen*paren (\unskip\fi
  1186.           \if*nen*sb [\unskip\fi
  1187.           \if*nen*num \the\en*n\fi
  1188.           \if*nen*let \a*c{\the\en*n}\fi
  1189.           \if*nenll*per \unskip.\fi
  1190.           \if*nen*paren \unskip)\fi
  1191.           \if*nen*sb \unskip]\fi}%
  1192.   \en*o
  1193.   \immediate\write\en*f{\par%
  1194.       \the\*enpar%
  1195.       \noexpand\ENP{\the\*nenrfont\J}}%
  1196.   \en*w}
  1197. \let\aen=\autoendnote
  1198. %
  1199. %
  1200. % Replace the current lines 1096--1098 in TEXT1@@ with the
  1201. % following:
  1202. %
  1203. \def\ENP#1{\indent\en*i{%
  1204.                     \if*nenupchar \raise.7ex\hbox{\the\*nenrfont#1}%
  1205.                     \else {\the\*nenrfont#1}\fi}}%
  1206. %
  1207. \def\en*i#1{\hbox to 0pt{\hss{#1}\hskip\*neng}\ignorespaces}
  1208. %
  1209. \newwrite\en*f
  1210. \def\en*o{\immediate\openout\en*f=text1$$.end%
  1211.              \immediate\write\en*f{\the\*enpar}%
  1212.              \edef\T{\par\vskip\the\en*s\relax}%
  1213.              \immediate\write\en*f{\T}%
  1214.              \global\def\en*o{}%
  1215.              }
  1216. %
  1217. \long\def\en*w#1{{\def\rm{\noexpand\rm}\def\it{\noexpand\it}%
  1218.    \def\underscore{\noexpand\us}\let\us=\underscore%
  1219.    \def\bd{\noexpand\bd}\def\cc{\noexpand\cc}\def\tt{\noexpand\tt}%
  1220.    \def\c{\noexpand\c}\def\L{\noexpand\L}\def\AA{\noexpand\AA}%
  1221.    \def\d{\noexpand\d}\def\O{\noexpand\O}\def\t{\noexpand\t}%
  1222.    \def\b{\noexpand\b}%
  1223.    \immediate\write\en*f{#1}}%
  1224. }% end definition of en*w
  1225. %
  1226. \def\printendnotes{\immediate\closeout\en*f%
  1227.    \begingroup%
  1228.    \input text1$$.end%
  1229.    \par%
  1230.    \endgroup%
  1231.    \global\def\en*o{\immediate\openout\en*f=text1$$.end%
  1232.                  \immediate\write\en*f{\the\*enpar}%
  1233.                  \edef\T{\par\vskip\the\en*s\relax}%
  1234.                  \immediate\write\en*f{\T}%
  1235.                  \global\def\en*o{}}%
  1236.    \setendnotenumber{0}}%
  1237. \let \pen=\printendnotes
  1238. %
  1239. %
  1240. %
  1241. \def\set#1#2{\l*alphafalse
  1242. \ifx#2\appendixnumber
  1243.     \edef\T{\the\*ap*num}%
  1244.     \E=\*ap*st%
  1245.  \else\ifx#2\chapternumber
  1246.            \edef\T{\the\*ch*num}%
  1247.            \E=\*ch*st%
  1248.  \else\ifx#2\endnotenumber
  1249.            \edef\T{\the\en*n}%
  1250.            \if*ten*num         \E=1%            % all numeric styles
  1251.              \else\l*alphatrue \E=2%            % all alpha styles
  1252.                   \fi%
  1253.  \else\ifx#2\figurenumber
  1254.            \edef\T{\the\fi*n}%
  1255.            \E=1%
  1256.  \else\ifx#2\footnotenumber
  1257.            \edef\T{\the\fn*num}%
  1258.            \if*tfn*dnum        \E=1%            % "1." style
  1259.              \else\if*tfn*unum \E=1%            % "1" style
  1260.              \else\if*tfn*pnum \E=1%            % "(1)" style
  1261.              \else\l*alphatrue \E=2%            % "a.", "a", and "(a)"
  1262.                   \fi\fi\fi%
  1263.  \else\ifx#2\partnumber
  1264.            \edef\T{\the\*pt*num}%
  1265.            \E=\*pt*st%
  1266.  \else\ifx#2\pagenumber
  1267.            \ifnum  \pageno<0 \edef\T{\romannumeral-\pageno}%
  1268.              \else \edef\T{\number\pageno}\fi%
  1269.            \E=1%
  1270.  \else\ifx#2\subheadanumber
  1271.            \edef\T{\the\*sa*num}%
  1272.            \E=\sa*st%
  1273.  \else\ifx#2\subheadbnumber
  1274.            \edef\T{\the\*sb*num}%
  1275.            \E=\sb*st%
  1276.  \else\ifx#2\subheadcnumber
  1277.            \edef\T{\the\*sc*num}%
  1278.            \E=\sc*st%
  1279.  \else\ifx#2\subheaddnumber
  1280.            \edef\T{\the\*sd*num}%
  1281.            \E=\sd*st%
  1282.  \else\ifx#2\tablenumber
  1283.            \edef\T{\the\ta*n}%
  1284.            \E=1%
  1285.  \else\message{<TEXT1> Error! You've entered a number I know nothing
  1286.        about. I'm going to ignore it and try to proceed.}%
  1287.            \E=0%
  1288.   \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
  1289. \null                           % So, why is this needed??
  1290. \ifcase\E                       % NOP
  1291.    \or                          % set to a digit or lower case roman
  1292.       \expandafter\xdef\csname#1\endcsname{\T}%
  1293.    \or                          % set to a letter (upper or lower)
  1294.       \expandafter\xdef\csname#1\endcsname{{\a*c{\T}}}%
  1295.    \or                          % set to an uppercase roman numeral
  1296.       \expandafter\xdef\csname#1\endcsname{%
  1297.             \uppercase\expandafter{\romannumeral\T}}%
  1298.                        \fi}%
  1299. %
  1300. %   CENTERLINE                                          Rev.  9/6/88 drg
  1301. %
  1302. % Centerline with single and multiple line capabilities
  1303. \newif\if*afn*cl
  1304. \def\centerline#1{\par % Begin centerline markup
  1305.     \*afn*clfalse
  1306.     \B={}
  1307.     \N=0
  1308.     \bgroup
  1309.     \parindent=\z@ \relax            % zero indent
  1310.     \parfillskip=0pt plus1fil \relax % infinite stretch
  1311.     \everypar{\null\hskip0pt plus1fil\relax} % add infinite glue
  1312.     \def\linebreak{\hskip0pt plus1fil\relax\break
  1313.                    \null\hskip0pt plus1fil\relax}%
  1314.     \let\lbr=\linebreak
  1315.     \let\toclinebreak=\space
  1316.     \let\toclbr=\space
  1317.     \justify
  1318.     \let\*vfn=\vfootnote
  1319.     \let\*afn=\autofootnote
  1320.     \def\vfootnote##1##2{\edef\T{\the\B\noexpand\vfootnote{##1}{##2}}
  1321.                \global\B=\expandafter{\T}}
  1322.     \def\autofootnote{\global\*afn*cltrue
  1323.           \global\advance\N by 1   % count the notes done
  1324.           \*afn}
  1325.     \let\afn=\autofootnote
  1326.     \let\*fn=\footnote
  1327.     \def\footnote##1{\global\*afn*cltrue \*fn{##1}}
  1328.     \setbox\A=\vbox{#1\par % added to make skip with multiple lines
  1329.                       \global\C=\baselineskip
  1330.                       \setbox0=\hbox{(}
  1331.                       \global\advance\C by-\ht0}% end vbox
  1332.     \global\advance\fn*num by -\N    %subtract the number of notes done
  1333.     \let\autofootnote=\*afn \let\afn=\autofootnote
  1334.     \let\footnote=\*fn
  1335.     \let\vfootnote=\*vfn
  1336.     \ifdim\ht\A>\baselineskip \else \C=\z@ \fi
  1337.     \line{\hss\vbox{\vskip\C#1\par}\hss}% print centered lines
  1338.     \egroup
  1339.     \if*afn*cl           % then there were footnotes in the \cl
  1340.        \the\B
  1341.        \fi
  1342.     }% End centerline markup
  1343. \let\cl=\centerline
  1344. %
  1345. %   CENTER MULTIPLE LINES
  1346. %
  1347. \newif\if*ctrl                       % centerline indicator
  1348. \*ctrlfalse
  1349. \def\centerlinesbegin{\par\global\*ctrltrue
  1350.     \begingroup\pin{0pt}\psk{0pt}\leftskip=0pt plus1fil
  1351.     \parfillskip=0pt \rightskip=0pt plus1fil\obeylines\ignorespaces}%
  1352. \let\clb=\centerlinesbegin
  1353. \def\centerlinesend{\endgroup\par}
  1354. \let\cle=\centerlinesend
  1355. %
  1356. %   rightline      par added to PLAIN TEX macro
  1357. %
  1358. \long\def\rightline#1{\par\line{\hss#1}}
  1359. \let\rl=\rightline
  1360. %
  1361. %   right align multiple lines
  1362. %
  1363. \def\rightlinesbegin{\par\begingroup\parskip=0pt\parfillskip=0pt
  1364.     \leftskip=0pt plus1fil\obeylines}%
  1365. \let\rlb=\rightlinesbegin
  1366. \def\rightlinesend{\endgroup\par}%
  1367. \let\rle=\rightlinesend
  1368. %
  1369. %                 As is  or format off
  1370. %
  1371. \newskip\*aisb  \*aisb = 6pt     % Default skip before
  1372. \newskip\*aisa  \*aisa = 6pt     % Default skip after
  1373. \newtoks\*aif   \*aif={\leftindent{0in}}
  1374. \newif\if*aib   \*aibfalse           % centerline indicator
  1375. %
  1376. \def\asisformat#1{{%
  1377.   \def\everyasis##1{\global\*aif{##1}}%
  1378.   \def\skipbefore##1{\global\*aisb=##1\relax}%
  1379.   \def\skipafter##1{\global\*aisa=##1\relax}%
  1380.   \relax
  1381.  #1}} % end of asisformat
  1382. \let\aif=\asisformat
  1383. %
  1384. %                 As is  or format off
  1385. \def\asisbegin{\par\*aibtrue\vskip\*aisb\relax\nointerlineskip
  1386.     \begingroup
  1387.     \let\*afn=\autofootnote          % save definition of autofootnote
  1388.                \def\leftindent##1{%
  1389.                      \*zerofalse \*okfalse
  1390.                      \e*p##1\end%
  1391.                      \if*zero \leftskip 0pt \fi
  1392.                      \advance \leftskip by ##1}%
  1393.                \let\lin=\leftindent
  1394. %
  1395.     \def\autofootnote{\endgroup      % end asis format
  1396.         \futurelet\next\ck*chr}%       pick next character, then check the pick
  1397.     \let\afn=\autofootnote           % reset abbreviation for autofootnote
  1398.     \def\ck*chr{\ifcat\bgroup        % if left brace
  1399.                    \noexpand\next    % do nothing
  1400.                     \let\next\gather % next equals gather
  1401.                  \else               % no brace present
  1402.                      \let\next\re*group\fi % stop if no brace encountered
  1403.           \next}%
  1404.     \def\gather{\*afn                % call normal autofootnote
  1405.                 \bgroup              % furnish left brace, read group
  1406.                 \aftergroup\re*group % reset asis format
  1407.                 \let\next}%            eat curly brace in text
  1408.                                      % group ends at text right curly brace
  1409.     \def\re*group{\*asisb}%            restore asis group
  1410. %
  1411.    \def\*asisb{\begingroup
  1412.                \def\singlespace{\baselineskip=\*isk}%
  1413.                \let\ssp=\singlespace
  1414.                \def\doublespace{\baselineskip=2\*isk}%
  1415.                \let\dsp=\doublespace
  1416.                \def\par{\leavevmode\endgraf}%
  1417.                \parskip0pt\parindent0pt
  1418.                \the\*aif
  1419.                \setupverbatim}\*asisb}
  1420.  {\obeyspaces\gdef {\ }}
  1421. \def\setupverbatim{\obeylines
  1422.                    \obeyspaces }
  1423. \let\aib=\asisbegin
  1424. \def\asisend{\endgroup\endgroup\vskip\*aisa\relax\*aibfalse}
  1425. \let\aie=\asisend
  1426. %
  1427. %     Draw boxes
  1428. %
  1429. \newdimen\db*m            \db*m=3pt
  1430. \newdimen\db*s            \db*s=.4pt
  1431. %
  1432. \long\def\drawbox#1{\vbox{\hrule height\db*s
  1433.         \hbox{\vrule width\db*s\hskip\db*m
  1434.            \vbox{\vskip\db*m
  1435.               \hbox{#1}
  1436.               \vskip\db*m}\hskip\db*m\vrule width\db*s}
  1437.         \hrule height\db*s}}
  1438. \let\db=\drawbox
  1439. %
  1440. \def\drawboxformat#1{{%
  1441.   \def\boxmat##1{\global\db*m=##1\relax}%
  1442.   \def\boxrule##1{\global\db*s=##1\relax}%
  1443.   #1}} % end of drawboxformat
  1444. \let\dbf=\drawboxformat
  1445. %
  1446. \def\drawboxrulesize#1{\dbf{\boxrule{#1}}
  1447.   \message{<TEXT1> Warning: Use drawboxformat instead of drawboxrulesize}}
  1448. \let\dbrs=\drawboxrulesize
  1449. \def\drawboxmat#1{\dbf{\boxmat{#1}}
  1450.   \message{<TEXT1> Warning: Use drawboxformat instead of drawboxmat}}
  1451. \let\dbm=\drawboxmat
  1452. %
  1453. %     Paragraph boxes
  1454. %
  1455. \newdimen\pb*m            \pb*m=3pt
  1456. \newdimen\pb*s            \pb*s=.4pt
  1457. %
  1458. \long\def\paragraphbox#1{\par\hbox{\vbox{\hrule height\pb*s
  1459.         \hbox{\vrule width\pb*s\hskip\pb*m
  1460.            \vbox{\vskip\pb*m
  1461.               \hbox{\vbox{\advance \hsize by -2\pb*m
  1462.                           \advance \hsize by -2\pb*s
  1463.                           \hrule width \hsize height 0pt depth 0pt
  1464.                           #1}}
  1465.               \vskip\pb*m}\hskip\db*m\vrule width\pb*s}
  1466.         \hrule height\pb*s}}}
  1467. \let\pb=\paragraphbox
  1468. %
  1469. \def\paragraphboxformat#1{{%
  1470.   \def\boxmat##1{\global\pb*m=##1\relax}%
  1471.   \def\boxrule##1{\global\pb*s=##1\relax}%
  1472.   #1}} % end of paragraphboxformat
  1473. \let\pbf=\paragraphboxformat
  1474. %
  1475. %   page skip
  1476. %
  1477. \def\newpage{\vfil\break}% changed from vfill to vfil 11/4/86 bth
  1478. \let\np=\newpage
  1479. %
  1480. %   emptypage
  1481. %
  1482. \def\emptypage{\global\advance\*pcount by1}% produces empty pages
  1483. %
  1484. \def\*blkpg{ % BLANK PAGE MACRO, produces the empty page
  1485.     \loop %                            checks the number of empty pages
  1486.        \*badj %                        check for binding adjust
  1487.        \shipout\vbox{\makeheadline   % shipout page with headline and
  1488.                      \vbox to\*txth{\vfil} % fooline only
  1489.                      \makefootline}
  1490.        \global\advance\*pcount by\m@ne % decrement empty page counter
  1491.        \advancepageno                % advance the page number
  1492.     \ifnum\*pcount>0                 % check for multiple empty pages
  1493.     \repeat}% END, empty page macro
  1494. \let\ep=\emptypage
  1495. %
  1496. %   List Level Macros
  1497. %
  1498. \newcount\ll*n             % Current list level number
  1499. \newcount\*toklimit
  1500. \newcount\*countlimit
  1501. \newcount\ll*stb           % list style start
  1502. \newcount\ll*cs            % list*enum*value*start
  1503. \newcount\ll*cmps          % list compare start
  1504. \newcount\ll*cmpe
  1505. \newcount\ll*lc            % Last level called
  1506. \*toklimit = 188           % Positions 224-253 are used for the 30 table column justification
  1507.                            % Positions 199-223 are used for the 25 different list level styles
  1508.                            % Tokens below 199 are available for \newtoks use.
  1509.                            % Token 190 is the build token
  1510.                            % 191-197 is the list level formats, level 1-7
  1511.                            % 198 is the bullet format
  1512. %
  1513. \*countlimit = 236         % Counters 244-250 are the styles for the 7 list levels
  1514.                            % Counters 237-243 are the enum counters for the 7 list levels
  1515.                            % Counters below 237 are available for \newcount use.
  1516. %
  1517. \ll*stb = 244              % Counters 244-250 correspond to the 7 list level styles,
  1518.                            %         value is index into tokens 199-223
  1519. \ll*cs = 237               % Counters 237-243 correspond to the 7 list level enum values.
  1520. \ll*cmps = 199             % Where to start in the \toks values for the 25 different list level styles
  1521. \ll*cmpe = 223             % Where to stop in the \toks values for the 25 different list level styles
  1522. %
  1523. \count244 = 1      % style "1."
  1524. \count245 = 4      % style "a."
  1525. \count246 = 7      % style "i."
  1526. \count247 = 2      % style "1)"
  1527. \count248 = 5      % style "a)"
  1528. \count249 = 8      % style "i)"
  1529. \count250 = 3      % style "(1)"
  1530. %
  1531. \newskip\ll*sb     \ll*sb = 0pt     % Default is no \vskip
  1532. \newskip\ll*sa     \ll*sa = 0pt       % Default is no \vskip
  1533. %
  1534. \toks191={\rm\leftindent{.5in}\gutter{1em}}      % level 1 indent is 5 characters initially
  1535. \toks192={\rm\leftindent{.8in}\gutter{1em}}      % level 2 indent
  1536. \toks193={\rm\leftindent{1.1in}\gutter{1em}}     % level 3 indent
  1537. \toks194={\rm\leftindent{1.4in}\gutter{1em}}     % level 4 indent
  1538. \toks195={\rm\leftindent{1.7in}\gutter{1em}}     % level 5 indent
  1539. \toks196={\rm\leftindent{2in}\gutter{1em}}       % level 6 indent
  1540. \toks197={\rm\leftindent{2.3in}\gutter{1em}}     % level 7 indent
  1541. \toks198={\rm\leftindent{+.5in}\gutter{1em}}     % bullets
  1542. %
  1543.                            % The 25 different List level styles:
  1544. \toks199 = {1.}            % Style 1
  1545. \toks200 = {1)}            %       2
  1546. \toks201 = {(1)}           %       3
  1547. \toks202 = {a.}            %       4
  1548. \toks203 = {a)}            %       5
  1549. \toks204 = {(a)}           %       6
  1550. \toks205 = {i.}            %       7
  1551. \toks206 = {i)}            %       8
  1552. \toks207 = {(i)}           %       9
  1553. \toks208 = {I.}            %      10
  1554. \toks209 = {I)}            %      11
  1555. \toks210 = {(I)}           %      12
  1556. \toks211 = {A.}            %      13
  1557. \toks212 = {A)}            %      14
  1558. \toks213 = {(A)}           %      15
  1559. \toks214 = {1]}            %      16
  1560. \toks215 = {[1]}           %      17
  1561. \toks216 = {a]}            %      18
  1562. \toks217 = {[a]}           %      19
  1563. \toks218 = {i]}            %      20
  1564. \toks219 = {[i]}           %      21
  1565. \toks220 = {I]}            %      22
  1566. \toks221 = {[I]}           %      23
  1567. \toks222 = {A]}            %      24
  1568. \toks223 = {[A]}           %      25
  1569. %
  1570. \newif\if*check    % True unless done parsing \listformat
  1571. \newif\ifll*lp
  1572. \newif\ifll*rp
  1573. \newif\if*lsqb
  1574. \newif\if*rsqb
  1575. \newif\ifll*per
  1576. \newif\ifll*dig
  1577. \newif\ifl*alpha
  1578. \newif\if*u*alpha
  1579. \newif\if*l*roman
  1580. \newif\if*u*roman
  1581. \newif\ifll*nil
  1582. %
  1583. \ll*niltrue
  1584. %
  1585. \outer\def\newtoks{\alloc@5\toks\toksdef\*toklimit}
  1586. \outer\def\newcount{\alloc@0\count\countdef\*countlimit}
  1587. %
  1588. %
  1589. %  Macros for producing enumerated list levels.
  1590. %
  1591. %
  1592. \def\listformat#1{{\begingroup%
  1593.           \def\liststyle##1{\par\N = 1
  1594.                             \toks190 = {}
  1595.                             \Z##1\end}%
  1596.           \def\Z##1{\ifx ##1\end \Y
  1597.                                  \let \next = \relax
  1598.                     \else \ifnum \N > 7
  1599.                                  \message{<TEXT1> Error! Too many list levels specified, 7 is max.
  1600.                                           Statement ignored.}
  1601.                                  \let \next = \Z
  1602.                           \else \ifx ##1, \Y
  1603.                                           \advance \N by 1
  1604.                                           \toks190 = {}
  1605.                                           \let \next = \Z
  1606.                                 \else \toks190 = \expandafter{\the\toks190 ##1}
  1607.                                       \let \next = \Z
  1608.                    \fi\fi\fi\next}%
  1609.           \def\Y{\*tempiffalse
  1610.                  \*checktrue
  1611.                  \E = \ll*cmps
  1612.                  \loop \ifnum \E > \ll*cmpe
  1613.                               \*checkfalse
  1614.                               \*tempiftrue
  1615.                        \else  \edef\T{\the\toks190}%
  1616.                               \edef\U{\the\toks\E}%
  1617.                               \ifx\T\U
  1618.                                         \*checkfalse
  1619.                                         \F = \ll*stb
  1620.                                         \advance \F by -1
  1621.                                         \advance \F by \N
  1622.                                         \count\F = \E
  1623.                                         \advance \count\F by -\ll*cmps
  1624.                                         \global\advance \count\F by 1
  1625.                         \fi\fi
  1626.                    \if*check% Then
  1627.                               \advance \E by 1
  1628.                    \repeat
  1629.              \if*tempif \message{<TEXT1> Error! \the\toks190 is an invalid list
  1630.                                              level style. It will be ignored}
  1631.                  \fi}%
  1632.           \def\skipbefore##1{\global\ll*sb = ##1\relax}%
  1633.           \def\skipafter##1{\global\ll*sa = ##1\relax}%
  1634.           \def\everylistlevel##1##2{\ifcase ##1
  1635.                 \or \global\toks191 = {##2}
  1636.                 \or \global\toks192 = {##2}
  1637.                 \or \global\toks193 = {##2}
  1638.                 \or \global\toks194 = {##2}
  1639.                 \or \global\toks195 = {##2}
  1640.                 \or \global\toks196 = {##2}
  1641.                 \or \global\toks197 = {##2}
  1642.                 \fi}%
  1643.           \def\everybullet##1{\global\toks198 = {##1}}%
  1644.           \relax
  1645.           #1
  1646.           \endgroup}}
  1647. %
  1648. \let \lif = \listformat
  1649. %
  1650. \def\listbegin{\vskip\ll*sb\relax
  1651.                \ll*nilfalse
  1652.                \begingroup
  1653.                \global\ll*lc = 0
  1654.                \ll*ini1
  1655.  }
  1656. \let\lib=\listbegin
  1657. %
  1658. \def\listend{\vskip\ll*sa\relax
  1659.              \endgroup
  1660.              \ll*niltrue
  1661. }
  1662. \let\lie=\listend
  1663. %
  1664. \def\listlevel#1{\par
  1665.                  \ifll*nil \message{<TEXT1> Warning, listbegin was not
  1666.                                     specified. The left margin indent will be set to zero.}
  1667.                                 \else \if*dbl \else \if*tpl
  1668.        % If in multiple columns, don't end the group. Do so otherwise
  1669.                                       \else \endgroup
  1670.                                             \begingroup
  1671.                                             \fi\fi
  1672.                                       \fi
  1673.                  \*tempiftrue                           % Usually not quite so pessimistic
  1674.                  \ifcat 1#1 \ifnum #1 < 8 \*tempiffalse % OK if \listlevel1-\listlevel7
  1675.                      \fi\fi
  1676.                  \if*tempif \message{<TEXT1> Warning, invalid list level "#1",
  1677.                                                  listlevel1 will be used instead.}
  1678.                                      \listlevel1
  1679.                       \else \E = #1
  1680.                             \global\ll*n = \E
  1681.                             \advance \E by 1
  1682.                             \ll*ini\E
  1683.                             \par
  1684.                             \ll*fmt
  1685.                             \noindent
  1686.                             \txt*in{\ll*p{#1}}
  1687.                       \fi
  1688. }
  1689. \let \lil = \listlevel
  1690. %
  1691. \def\txt*in#1{\hbox to 0pt{\hss{#1}\hskip\*gut}\ignorespaces}
  1692. %
  1693. \def\ll*fmt{\*gut=1em
  1694.                   \ifcase \the\ll*n
  1695.                             \or \the\toks191
  1696.                             \or \the\toks192
  1697.                             \or \the\toks193
  1698.                             \or \the\toks194
  1699.                             \or \the\toks195
  1700.                             \or \the\toks196
  1701.                             \or \the\toks197
  1702.                             \fi}
  1703. %
  1704. \def\listresume{% rev. 7/6/87
  1705.     \if*start*bul\global\advance\ll*n by 1\global\*start*bulfalse\fi
  1706.                                      % account for bulleted list ffems
  1707.     \ifnum \ll*n < 2 \lin{0pt}
  1708.                      \global\ll*n = 1
  1709.                \else \global\advance \ll*n by -1
  1710.                      \ll*fmt
  1711.                      \fi
  1712.                 \noindent\ignorespaces}
  1713. %
  1714. \let\lir=\listresume
  1715. %                              Evaluate Style
  1716. \def\e*s{%
  1717.     \global\ll*lpfalse
  1718.     \global\ll*rpfalse
  1719.     \global\*lsqbfalse
  1720.     \global\*rsqbfalse
  1721.     \global\ll*perfalse
  1722.     \global\ll*digfalse
  1723.     \global\l*alphafalse
  1724.     \global\*u*alphafalse
  1725.     \global\*l*romanfalse
  1726.     \global\*u*romanfalse
  1727.     \ifcase \count\F
  1728.             \or \global\ll*digtrue \global\ll*pertrue                        % Style  1
  1729.             \or \global\ll*digtrue \global\ll*rptrue                         %        2
  1730.             \or \global\ll*digtrue \global\ll*rptrue \global\ll*lptrue       %        3
  1731.             \or \global\l*alphatrue \global\ll*pertrue                       %        4
  1732.             \or \global\l*alphatrue \global\ll*rptrue                        %        5
  1733.             \or \global\l*alphatrue \global\ll*rptrue \global\ll*lptrue      %        6
  1734.             \or \global\*l*romantrue \global\ll*pertrue                      %        7
  1735.             \or \global\*l*romantrue \global\ll*rptrue                       %        8
  1736.             \or \global\*l*romantrue \global\ll*rptrue \global\ll*lptrue     %        9
  1737.             \or \global\*u*romantrue \global\ll*pertrue                      %       10
  1738.             \or \global\*u*romantrue \global\ll*rptrue                       %       11
  1739.             \or \global\*u*romantrue \global\ll*rptrue \global\ll*lptrue     %       12
  1740.             \or \global\*u*alphatrue \global\ll*pertrue                      %       13
  1741.             \or \global\*u*alphatrue \global\ll*rptrue                       %       14
  1742.             \or \global\*u*alphatrue \global\ll*rptrue \global\ll*lptrue     %       15
  1743.             \or \global\ll*digtrue \global\*rsqbtrue                         %       16
  1744.             \or \global\ll*digtrue \global\*rsqbtrue \global\*lsqbtrue       %       17
  1745.             \or \global\l*alphatrue \global\*rsqbtrue                        %       18
  1746.             \or \global\l*alphatrue \global\*rsqbtrue \global\*lsqbtrue      %       19
  1747.             \or \global\*l*romantrue \global\*rsqbtrue                       %       20
  1748.             \or \global\*l*romantrue \global\*rsqbtrue \global\*lsqbtrue     %       21
  1749.             \or \global\*u*romantrue \global\*rsqbtrue                       %       22
  1750.             \or \global\*u*romantrue \global\*rsqbtrue \global\*lsqbtrue     %       23
  1751.             \or \global\*u*alphatrue \global\*rsqbtrue                       %       24
  1752.             \or \global\*u*alphatrue \global\*rsqbtrue \global\*lsqbtrue     %       25
  1753.             \fi}
  1754.  
  1755. %
  1756. \def\ll*ini#1{\*start*bulfalse
  1757.                \ifnum #1 < 7 \N = #1
  1758.                              \advance \N by -1
  1759.                              \loop \ifnum \N < 7         % Loop max of 7 times
  1760.                                           \E = \N
  1761.                                           \advance \E by \ll*cs
  1762.                                           \global\count\E = 0
  1763.                                           \advance \N by 1
  1764.                                           \repeat
  1765.                              \fi}           % else don't initialize when \lil7
  1766. %
  1767. \def\ll*p#1{%
  1768.            \E = #1
  1769.            \advance \E by \ll*cs
  1770.            \advance \E by -1                 % \E is the listlevel value counter
  1771.            \F = \E
  1772.            \advance \F by 7
  1773.            \global\advance \count\E by 1     % Increment the list level counter
  1774.      %
  1775.      % If this level is same as previous level, no need to re-evaluate
  1776.      % the style to be used.
  1777.      %
  1778.            \ifnum \ll*lc = #1
  1779.                   \else \e*s
  1780.                         \global\ll*lc = #1
  1781.                   \fi
  1782.      %
  1783.      % Print the prefix punctuation
  1784.      %
  1785.            \ifll*lp  (\unskip                    % Styles 3, 6, 9, 12, 15
  1786.               \else \if*lsqb [\unskip            % Styles 17, 19, 21, 23, 25
  1787.                    \fi\fi
  1788.      %
  1789.      % Print the listlevel value, i.e. "1", "a", "A", "I", or "i".
  1790.      %
  1791.            \ifll*dig                            % Then its a style using digits
  1792.                           \number\count\E       % Print the number
  1793.                           \unskip               % To get rid of any following extra spaces
  1794.                   \else \ifl*alpha              % Then its a style with lower case letters
  1795.                           \a*c{\count\E}        % Print the lower case letters
  1796.                           \unskip               % To get rid of any following extra spaces
  1797.                   \else \if*u*alpha             % Then its a style with upper case letters
  1798.                           \a*c{\count\E}        % Print uppercase alpha
  1799.                           \unskip               % To get rid of any following extra spaces
  1800.                   \else \if*l*roman             % Then its a style with lower case roman numerals
  1801.                           \romannumeral\count\E % Print the lower case roman numeral
  1802.                           \unskip               % To get rid of any following extra spaces
  1803.                   \else \if*u*roman             % Print upper case roman numeral
  1804.                           \uppercase\expandafter{\romannumeral\count\E}
  1805.                           \unskip               % To get rid of any following extra spaces
  1806.                   \else \message{<TEXT1> Error! Something is awry in the listlevel style. Call a consultant.}
  1807.                   \fi\fi\fi\fi\fi
  1808.      %
  1809.      % Print the suffix punctuation
  1810.      %
  1811.            \ifll*per .\unskip             % Styles 1, 4, 7, 10, 13
  1812.               \else \ifll*rp )\unskip     % Styles 2, 3, 5, 6, 8, 9, 11, 12, 14, 15
  1813.                  \else \if*rsqb ]\unskip  % Styles 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
  1814.            \fi\fi\fi
  1815. }
  1816.      %
  1817.      % This macro will convert an integer into a letter. In Appendix F of the
  1818.      % TeXbook you will see that octal character '141 is the small letter "a".
  1819.      % Octal 141=Decimal 97, Therefore, add 96 to value of listlevel counter.
  1820.      % For example, 1="a", 2="b", etc. The macro will also change 27="aa", 28="ab", etc.
  1821.      %
  1822. \def\a*c#1{%
  1823.   \ifnum #1 < 27 \G = #1%                 % Then its a single letter a-z
  1824.           \advance \G by 96%              % See the font table in App. F
  1825.           \ifl*alpha%                     % Then its a lower case style
  1826.                   \char\G%                % Print the character a-z
  1827.             \else \advance \G by -32%
  1828.                   \char\G%                % Print the character A-Z
  1829.             \fi%
  1830.     \else \G = #1%                        % else its "AA" or greater
  1831.           \divide \G by 26%               % This holds the first character
  1832.           \Q = #1%                        % Get ready to compute second letter
  1833.           \R = #1%
  1834.           \divide \R by 26%
  1835.           \multiply \R by 26%
  1836.           \ifnum #1 = \R%
  1837.                    \advance \G by -1%
  1838.                    \Q = 26%
  1839.              \else \advance \Q by -\R%
  1840.                    \fi%
  1841.           \a*c{\G}%                       % Get the first character a-z
  1842.           \unskip%
  1843.           \a*c{\Q}%                       % Get the second letter
  1844.           \fi}                            % End of \a*c
  1845. %
  1846. %
  1847. %  Bullets
  1848. %
  1849. \newif\if*start*bul
  1850. \newdimen\*bul*dim
  1851. \mathchardef\*bullet="220F
  1852. \def\bullet{% bullet defined for both math and text modes, rev. 6/25/87
  1853.     \ifmmode \*bullet                % math mode bullet
  1854.        \else                         % text or list bullet
  1855.           \ifll*nil                  % no list in progress, text bullet
  1856.              \leftskip = 0pt
  1857.              {\if*msp{*}\else\sy\char"0F\fi}
  1858.              \else                   % list in progress, list bullet
  1859.                 \the\toks198
  1860.                 \if*start*bul \lin{\*bul*dim}
  1861.                    \else \*bul*dim = \leftskip
  1862.                       \*start*bultrue \fi  % end starting bullet
  1863.                 \par\noindent
  1864.                 \txt*in{{\if*msp{*}\else\sy\char"0F\fi}}
  1865.              \fi % end list in progress check
  1866.        \fi % end math mode bullet check
  1867. }% end bullet
  1868. \let \bul=\bullet
  1869. %
  1870. %    Macros for doing Table of Contents, Heads, Subheads, Tables, and Figures
  1871. %
  1872. \newtoks\*TCt   \*TCt={\cl{\twelvept\bd Table of Contents}\vs{1\bl}}
  1873. \newtoks\*ptf   \*ptf={\vs{1\bl}\cl{Part \partnumber}\cl{\parttitle}%
  1874.                         \vs{1\bl}\nin Part \partnumber \leader \pagenumber}
  1875. \newtoks\*ctf    \*ctf={\hangingchapternumber \chaptertitle \leader \pagenumber}
  1876. \newtoks\*atf    \*atf={\hangingappendixnumber \appendixtitle \leader \pagenumber}
  1877. \newtoks\*prtf   \*prtf={\nin \prefacetitle \leader \pagenumber}
  1878. \newtoks\*satf   \*satf={\leftindent{.5in}\nin \subheadatitle \leader \pagenumber}
  1879. \newtoks\*sbtf   \*sbtf={\leftindent{1in}\nin \subheadbtitle \leader \pagenumber}
  1880. \newtoks\*sctf   \*sctf={\leftindent{1.5in}\nin \subheadctitle \leader \pagenumber}
  1881. \newtoks\*sdtf   \*sdtf={\leftindent{2in}\nin \subheaddtitle \leader \pagenumber}
  1882. \newtoks\*btf    \*btf={\nin\bibtitle \leader \pagenumber}
  1883. \newtoks\*ftf    \*ftf={\hangingnumber{\figurenumber.} \figuretitle \leader \pagenumber}
  1884. \newtoks\*ftt    \*ftt={\newpage\cl{\twelvept\bd List of Figures}\line{Figure\hfill Page}}
  1885. \newtoks\*ttf    \*ttf={\hangingnumber{\tablenumber.}  \tabletitle\leader \pagenumber}
  1886. \newtoks\*ttt    \*ttt={\newpage\cl{\twelvept\bd List of Tables}\line{Table\hfill Page}}
  1887. \newtoks\*figt   \*figt={\bqb\tenpt\bd\hp Figure \figurenumber. \rm\figuretitle \bqe}
  1888. \newtoks\*tabt   \*tabt={\vs{\bl}\cl{\twelvept\bd Table \tablenumber}%
  1889.                          \cl{\twelvept\tabletitle}\vs{\bl}}
  1890. \newtoks\*partt  \*partt={\dumpinsertseject\titlepage
  1891.                           \hrule height 0pt depth 0pt\vfil
  1892.                           \cl{\twelvept\bd Part \partnumber}
  1893.                           \cl{\twelvept\bd\parttitle}
  1894.                           \vs{.5\tp*sk}
  1895.                           \np
  1896.                           \scn{0}\ssan{0}\ssbn{0}\sscn{0}\ssdn{0}
  1897.                           \sfn{0}\stn{0}\sfnn{0}\senn{0}
  1898.                           }%
  1899. \newtoks\*chapt  \*chapt={\dumpinsertseject
  1900.                           \cl{\twelvept\bd Chapter \chapternumber}%
  1901.                           \cl{\twelvept\bd\chaptertitle}
  1902.                           \vs{1\bl}
  1903.                           \ssan{0}\ssbn{0}\sscn{0}\ssdn{0}
  1904.                           }
  1905. \newtoks\*appt   \*appt={\dumpinsertseject %
  1906.                          \cl{\twelvept\bd Appendix \appendixnumber}
  1907.                          \cl{\twelvept\bd\appendixtitle}
  1908.                          \vs{1\bl}
  1909.                          \scn{0}\ssan{0}\ssbn{0}\sscn{0}
  1910.                          \ssdn{0}\sfn{0}\stn{0}
  1911.                          }
  1912. \newtoks\*pret   \*pret={\dumpinsertseject %
  1913.                          \cl{\twelvept\bd\prefacetitle}
  1914.                          \vs{1\bl}
  1915.                          \ssan{0}\ssbn{0}\sscn{0}\ssdn{0}
  1916.                          }%
  1917. \newtoks\*subat  \*subat={\removelastskip\goodbreak
  1918.                           \vs{2\bl}
  1919.                           \nin\twelvept\bd\subheadatitle\par\nobreak
  1920.                           \vs{1\bl}\nobreak
  1921.                           \ssbn{0}\sscn{0}\ssdn{0}
  1922.                           }
  1923. \newtoks\*subbt  \*subbt={\removelastskip\goodbreak
  1924.                           \vs{2\bl}
  1925.                           \nin\twelvept\it\subheadbtitle\par\nobreak
  1926.                           \vs{1\bl}\nobreak
  1927.                           \sscn{0}\ssdn{0}
  1928.                           }
  1929. \newtoks\*subct  \*subct={\removelastskip\goodbreak
  1930.                           \vs{2\bl}
  1931.                           \nin\twelvept\subheadctitle\par\nobreak
  1932.                           \vs{1\bl}\nobreak
  1933.                           \ssdn{0}
  1934.                           }
  1935. \newtoks\*subdt   \*subdt={\goodbreak\twelvept\it\subheaddtitle.}
  1936. %
  1937. \newif\if*cont*chap   \*cont*chapfalse
  1938. \newif\if*TC*fig     \*TC*figtrue
  1939. \newif\if*TC*tab     \*TC*tabtrue
  1940. \newif\if*TC*prt     \*TC*prttrue
  1941. \newif\if*TC*chp     \*TC*chptrue
  1942. \newif\if*TC*app     \*TC*apptrue
  1943. \newif\if*TC*pre     \*TC*pretrue
  1944. \newif\if*TC*sha     \*TC*shatrue
  1945. \newif\if*TC*shb     \*TC*shbtrue
  1946. \newif\if*TC*shc     \*TC*shcfalse
  1947. \newif\if*TC*shd     \*TC*shdfalse
  1948. \newif\if*TCaopen    \*TCaopenfalse
  1949. \newif\if*TCbopen    \*TCbopenfalse
  1950. \newif\if*TCcopen    \*TCcopenfalse
  1951. %
  1952. \newdimen\*ch*hi     \*ch*hi=.25in
  1953. \newdimen\*ap*hi     \*ap*hi=.25in
  1954. \newdimen\fi*hi      \fi*hi=.25in
  1955. \newdimen\ta*hi      \ta*hi=.25in
  1956. %
  1957. \newcount\fi*n          \fi*n=0
  1958. \newcount\ta*n          \ta*n=0
  1959. \newcount\*pt*num       \*pt*num=0
  1960. \newcount\*pt*st        \*pt*st=1
  1961. \newcount\*ch*num       \*ch*num=0
  1962. \newcount\*ch*st        \*ch*st=1
  1963. \newcount\*ap*num       \*ap*num=0
  1964. \newcount\*ap*st        \*ap*st=2
  1965. \newcount\*sa*num       \*sa*num=0
  1966. \newcount\sa*st         \sa*st=1
  1967. \newcount\*sb*num       \*sb*num=0
  1968. \newcount\sb*st         \sb*st=1
  1969. \newcount\*sc*num       \*sc*num=0
  1970. \newcount\sc*st         \sc*st=1
  1971. \newcount\*sd*num       \*sd*num=0
  1972. \newcount\sd*st         \sd*st=1
  1973. %
  1974. \newwrite\TC*fa
  1975. \newwrite\TC*fb
  1976. \newwrite\TC*fc
  1977. %
  1978. \long\def\putincontents#1#2{\ifcase #1 % Putincontents markup
  1979.        \or \if*TCaopen      % Do nothing if open, else open it
  1980.               \else \immediate\openout\TC*fa=text1$$.tc1
  1981.                     \immediate\write\TC*fa{\the\*TCt}
  1982.                     \global\*TCaopentrue
  1983.               \fi
  1984.           {\def\pagenumber{\noexpand\pagenumber}%
  1985.            \def\pn{\noexpand\pagenumber}%
  1986.            \def\eightteenpt{\noexpand\noexpand\noexpand\eightteenpt}%
  1987.            \def\fourteenpt{\noexpand\noexpand\noexpand\fourteenpt}%
  1988.            \def\twelvept{\noexpand\noexpand\noexpand\twelvept}%
  1989.            \def\tenpt{\noexpand\noexpand\noexpand\tenpt}%
  1990.            \def\leavevmode{\noexpand\noexpand\noexpand\leavevmode}%
  1991.            \def\bullet{\noexpand\noexpand\noexpand\bullet}%
  1992.            \def\bul{\noexpand\noexpand\noexpand\bullet}%
  1993.            \def\AA{\noexpand\noexpand\noexpand\AA}%
  1994.            \def\aa{\noexpand\noexpand\noexpand\aa}%
  1995.            \def\dag{\noexpand\noexpand\noexpand\dag}%
  1996.            \def\ddag{\noexpand\noexpand\noexpand\ddag}%
  1997.            \def\neg{\noexpand\noexpand\noexpand\neg}%
  1998.            \def\tilde{\noexpand\noexpand\noexpand\tilde}%
  1999.            \def\\{\noexpand\noexpand\noexpand\\}%
  2000.            \def\{{\noexpand\noexpand\noexpand\{}%
  2001.            \def\}{\noexpand\noexpand\noexpand\}}%
  2002.            \def\_{\noexpand\noexpand\noexpand\_}%
  2003.            \def\leftindent##1{\leftskip=##1}%
  2004.            \def\lin##1{\leftskip=##1}%
  2005.            \def\toclinebreak{\noexpand\noexpand\noexpand\toclinebreak}%
  2006.            \def\toclbr{\noexpand\noexpand\noexpand\toclinebreak}%
  2007.            \let\lin=\leftindent
  2008.            \let\linebreak=\space
  2009.            \let\lbr=\space
  2010.            \def\underscore##1{\noexpand\noexpand\noexpand
  2011.                \underscore{##1}}%
  2012.            \let\us=\underscore
  2013.            \def\centerline##1{\noexpand\noexpand\noexpand
  2014.                \centerline{##1}}%
  2015.            \let\cl=\centerline
  2016.            \def\autoendnote##1{}%
  2017.            \let\aen=\autoendnote
  2018.            \def\autofootnote##1{}%
  2019.            \let\afn=\autofootnote
  2020.            \def\par{\endgraf}%
  2021.            \def\paragraph{\endgraf}%
  2022.            \def\justify{\noexpand\noexpand\noexpand\justify}%
  2023.            \let\ju=\justify
  2024.            \def\partnumber{\noexpand\noexpand\noexpand\sptn{\the\*pt*num}
  2025.                            \noexpand\noexpand\noexpand\partnumber}%
  2026.            \def\chapternumber{\noexpand\noexpand\noexpand\scn{\the\*ch*num}
  2027.                               \noexpand\noexpand\noexpand\chapternumber}%
  2028.            \def\appendixnumber{\noexpand\noexpand\noexpand\san{\the\*ap*num}
  2029.                                \noexpand\noexpand\noexpand\appendixnumber}%
  2030.            \def\subheadanumber{\noexpand\noexpand\noexpand\ssan{\the\*sa*num}
  2031.                                \noexpand\noexpand\noexpand\subheadanumber}%
  2032.            \def\subheadbnumber{\noexpand\noexpand\noexpand\ssbn{\the\*sb*num}
  2033.                                \noexpand\noexpand\noexpand\subheadbnumber}%
  2034.            \def\subheadcnumber{\noexpand\noexpand\noexpand\sscn{\the\*sc*num}
  2035.                                \noexpand\noexpand\noexpand\subheadcnumber}%
  2036.            \def\subheaddnumber{\noexpand\noexpand\noexpand\ssdn{\the\*sd*num}
  2037.                                \noexpand\noexpand\noexpand\subheaddnumber}%
  2038.            \def\hangingchapternumber{\noexpand\noexpand\noexpand\hangingchapternumber{\the\*ch*num}}%
  2039.            \def\hangingappendixnumber{\noexpand\noexpand\noexpand\hangingappendixnumber{\the\*ap*num}}%
  2040.            \def\hangingnumber##1{\noexpand\noexpand\noexpand\HFN{##1}}%
  2041.            \def\hangingparagraph{\noexpand\noexpand\noexpand\hangingparagraph}%
  2042.            \let\hp=\hangingparagraph
  2043.            \def\hangingindent##1{\noexpand\noexpand\noexpand\hangingindent{##1}}%
  2044.            \let\hin=\hangingparagraph
  2045.            \edef\T{\leftskip=0pt #2}%
  2046.            \edef\next{\write\TC*fa{\T\par}}%
  2047.            \next}%
  2048.        \or \if*TCbopen      % Do nothing if open, else open it
  2049.               \else \immediate\openout\TC*fb=text1$$.tc2
  2050.                     \immediate\write\TC*fb{\the\*ftt}
  2051.                     \global\*TCbopentrue\fi
  2052.           {\def\pagenumber{\noexpand\pagenumber}%
  2053.            \def\pn{\noexpand\pagenumber}%
  2054.            \def\partnumber{\noexpand\noexpand\noexpand\sptn{\the\*pt*num}
  2055.                            \noexpand\noexpand\noexpand\partnumber}%
  2056.            \def\chapternumber{\noexpand\noexpand\noexpand\scn{\the\*ch*num}
  2057.                               \noexpand\noexpand\noexpand\chapternumber}%
  2058.            \def\appendixnumber{\noexpand\noexpand\noexpand\san{\the\*ap*num}
  2059.                                \noexpand\noexpand\noexpand\appendixnumber}%
  2060.            \def\subheadanumber{\noexpand\noexpand\noexpand\ssan{\the\*sa*num}
  2061.                                \noexpand\noexpand\noexpand\subheadanumber}%
  2062.            \def\subheadbnumber{\noexpand\noexpand\noexpand\ssbn{\the\*sb*num}
  2063.                                \noexpand\noexpand\noexpand\subheadbnumber}%
  2064.            \def\subheadcnumber{\noexpand\noexpand\noexpand\sscn{\the\*sc*num}
  2065.                                \noexpand\noexpand\noexpand\subheadcnumber}%
  2066.            \def\subheaddnumber{\noexpand\noexpand\noexpand\ssdn{\the\*sd*num}
  2067.                                \noexpand\noexpand\noexpand\subheaddnumber}%
  2068.            \def\hangingchapternumber{\noexpand\noexpand\noexpand\hangingchapternumber{\the\*ch*num}}%
  2069.            \def\hangingappendixnumber{\noexpand\noexpand\noexpand\hangingappendixnumber{\the\*ap*num}}%
  2070.            \def\hangingnumber##1{\noexpand\noexpand\noexpand\HFN{##1}}%
  2071.            \def\hangingparagraph{\noexpand\noexpand\noexpand\hangingparagraph}%
  2072.            \let\hp=\hangingparagraph
  2073.            \def\hangingindent##1{\noexpand\noexpand\noexpand\hangingindent{##1}}%
  2074.            \let\hin=\hangingparagraph
  2075.            \def\eightteenpt{\noexpand\noexpand\noexpand\eightteenpt}%
  2076.            \def\fourteenpt{\noexpand\noexpand\noexpand\fourteenpt}%
  2077.            \def\twelvept{\noexpand\noexpand\noexpand\twelvept}%
  2078.            \def\tenpt{\noexpand\noexpand\noexpand\tenpt}%
  2079.            \def\bullet{\noexpand\noexpand\noexpand\bullet}%
  2080.            \def\bul{\noexpand\noexpand\noexpand\bullet}%
  2081.            \def\leavevmode{\noexpand\noexpand\noexpand\leavevmode}%
  2082.            \def\AA{\noexpand\noexpand\noexpand\AA}%
  2083.            \def\aa{\noexpand\noexpand\noexpand\aa}%
  2084.            \def\dag{\noexpand\noexpand\noexpand\dag}%
  2085.            \def\ddag{\noexpand\noexpand\noexpand\ddag}%
  2086.            \def\\{\noexpand\noexpand\noexpand\\}%
  2087.            \def\neg{\noexpand\noexpand\noexpand\neg}%
  2088.            \def\tilde{\noexpand\noexpand\noexpand\tilde}%
  2089.            \def\{{\noexpand\noexpand\noexpand\{}%
  2090.            \def\}{\noexpand\noexpand\noexpand\}}%
  2091.            \def\_{\noexpand\noexpand\noexpand\_}%
  2092.            \def\toclinebreak{\noexpand\noexpand\noexpand\toclinebreak}%
  2093.            \def\toclbr{\noexpand\noexpand\noexpand\toclinebreak}%
  2094.            \let\linebreak=\space
  2095.            \let\lbr=\space
  2096.            \def\underscore##1{\noexpand\noexpand\noexpand
  2097.               \underscore{##1}}%
  2098.            \let\us=\underscore
  2099.            \def\centerline##1{\noexpand\noexpand\noexpand
  2100.                \centerline{##1}}%
  2101.            \let\cl=\centerline
  2102.            \def\autoendnote##1{}%
  2103.            \let\aen=\autoendnote
  2104.            \def\autofootnote##1{}%
  2105.            \let\afn=\autofootnote
  2106.            \edef\T{#2}%
  2107.            \edef\next{\write\TC*fb{\T\par}}%
  2108.            \next}%
  2109.        \or \if*TCcopen      % Do nothing if open, else open it
  2110.               \else \immediate\openout\TC*fc=text1$$.tc3
  2111.                     \immediate\write\TC*fc{\the\*ttt}
  2112.                     \global\*TCcopentrue\fi
  2113.           {\def\pagenumber{\noexpand\pagenumber}%
  2114.            \def\pn{\noexpand\pagenumber}%
  2115.            \def\partnumber{\noexpand\noexpand\noexpand\sptn{\the\*pt*num}
  2116.                            \noexpand\noexpand\noexpand\partnumber}%
  2117.            \def\chapternumber{\noexpand\noexpand\noexpand\scn{\the\*ch*num}
  2118.                               \noexpand\noexpand\noexpand\chapternumber}%
  2119.            \def\appendixnumber{\noexpand\noexpand\noexpand\san{\the\*ap*num}
  2120.                                \noexpand\noexpand\noexpand\appendixnumber}%
  2121.            \def\subheadanumber{\noexpand\noexpand\noexpand\ssan{\the\*sa*num}
  2122.                                \noexpand\noexpand\noexpand\subheadanumber}%
  2123.            \def\subheadbnumber{\noexpand\noexpand\noexpand\ssbn{\the\*sb*num}
  2124.                                \noexpand\noexpand\noexpand\subheadbnumber}%
  2125.            \def\subheadcnumber{\noexpand\noexpand\noexpand\sscn{\the\*sc*num}
  2126.                                \noexpand\noexpand\noexpand\subheadcnumber}%
  2127.            \def\subheaddnumber{\noexpand\noexpand\noexpand\ssdn{\the\*sd*num}
  2128.                                \noexpand\noexpand\noexpand\subheaddnumber}%
  2129.            \def\hangingchapternumber{\noexpand\noexpand\noexpand\hangingchapternumber{\the\*ch*num}}%
  2130.            \def\hangingappendixnumber{\noexpand\noexpand\noexpand\hangingappendixnumber{\the\*ap*num}}%
  2131.            \def\hangingnumber##1{\noexpand\noexpand\noexpand\HTN{##1}}%
  2132.            \def\hangingparagraph{\noexpand\noexpand\noexpand\hangingparagraph}%
  2133.            \let\hp=\hangingparagraph
  2134.            \def\hangingindent##1{\noexpand\noexpand\noexpand\hangingindent{##1}}%
  2135.            \let\hin=\hangingparagraph
  2136.            \def\eightteenpt{\noexpand\noexpand\noexpand\eightteenpt}%
  2137.            \def\fourteenpt{\noexpand\noexpand\noexpand\fourteenpt}%
  2138.            \def\twelvept{\noexpand\noexpand\noexpand\twelvept}%
  2139.            \def\tenpt{\noexpand\noexpand\noexpand\tenpt}%
  2140.            \def\bullet{\noexpand\noexpand\noexpand\bullet}%
  2141.            \def\bul{\noexpand\noexpand\noexpand\bullet}%
  2142.            \def\leavevmode{\noexpand\noexpand\noexpand\leavevmode}%
  2143.            \def\AA{\noexpand\noexpand\noexpand\AA}%
  2144.            \def\aa{\noexpand\noexpand\noexpand\aa}%
  2145.            \def\dag{\noexpand\noexpand\noexpand\dag}%
  2146.            \def\ddag{\noexpand\noexpand\noexpand\ddag}%
  2147.            \def\\{\noexpand\noexpand\noexpand\\}%
  2148.            \def\neg{\noexpand\noexpand\noexpand\neg}%
  2149.            \def\tilde{\noexpand\noexpand\noexpand\tilde}%
  2150.            \def\{{\noexpand\noexpand\noexpand\{}%
  2151.            \def\}{\noexpand\noexpand\noexpand\}}%
  2152.            \def\_{\noexpand\noexpand\noexpand\_}%
  2153.            \def\toclinebreak{\noexpand\noexpand\noexpand\toclinebreak}%
  2154.            \def\toclbr{\noexpand\noexpand\noexpand\toclinebreak}%
  2155.            \let\linebreak=\space
  2156.            \let\lbr=\space
  2157.            \def\underscore##1{\noexpand\noexpand\noexpand
  2158.                \underscore{##1}}%
  2159.            \let\us=\underscore
  2160.            \def\centerline##1{\noexpand\noexpand\noexpand
  2161.                \centerline{##1}}%
  2162.            \let\cl=\centerline
  2163.            \def\autoendnote##1{}%
  2164.            \let\aen=\autoendnote
  2165.            \def\autofootnote##1{}%
  2166.            \let\afn=\autofootnote
  2167.            \edef\T{#2}%
  2168.            \edef\next{\write\TC*fc{\T\par}}%
  2169.            \next}%
  2170.        \else \message{<TEXT1> Warning, request for Contents entry other than
  2171.                       1, 2, or 3. Contents 1 will be assumed.}
  2172.              \putincontents1{#2}
  2173.        \fi}% End putincontents markup
  2174. \let\pic=\putincontents
  2175. %
  2176. \def\tableofcontentsformat#1{{%
  2177.       \def\continuechapter##1{\global\*cont*chapfalse
  2178.             \edef\T{##1}%
  2179.             \edef\U{yes}%
  2180.             \edef\V{no}%
  2181.             \ifx \T\U \global\*cont*chaptrue
  2182.                  \else \ifx \T\V   % Not continue chapter
  2183.                        \else \message{<TEXT1> Warning, argument to
  2184.                                       continuechapter is not "yes" or "no".
  2185.                                       "no" will be assumed}
  2186.                  \fi\fi}%
  2187.       \def\toctitle##1{\global\*TCt={##1}}%
  2188.       \def\parttocformat##1{\global\*ptf={##1}}%
  2189.       \def\chaptertocformat##1{\global\*ctf={##1}}%
  2190.       \def\hangingchapterindent##1{\global\*ch*hi=##1}%
  2191.       \def\appendixtocformat##1{\global\*atf={##1}}%
  2192.       \def\hangingappendixindent##1{\global\*ap*hi=##1}%
  2193.       \def\prefacetocformat##1{\global\*prtf={##1}}%
  2194.       \def\subheadatocformat##1{\global\*satf={##1}}%
  2195.       \def\subheadbtocformat##1{\global\*sbtf={##1}}%
  2196.       \def\subheadctocformat##1{\global\*sctf={##1}}%
  2197.       \def\subheaddtocformat##1{\global\*sdtf={##1}}%
  2198.       \def\bibliographytocformat##1{\global\*btf={##1}}%
  2199.       \def\figuretoctitle##1{\global\*ftt={##1}}%
  2200.       \def\figuretocformat##1{\global\*ftf={##1}}%
  2201.       \def\hangingfigureindent##1{\global\fi*hi=##1}%
  2202.       \def\tabletoctitle##1{\global\*ttt={##1}}%
  2203.       \def\tabletocformat##1{\global\*ttf={##1}}%
  2204.       \def\hangingtableindent##1{\global\ta*hi=##1}%
  2205.    #1}}
  2206. \let\tocf=\tableofcontentsformat
  2207. %
  2208. \def\tableofcontents#1{%
  2209.       \edef\T{}\edef\U{#1}\ifx\T\U\E=-3\else\E=#1\fi
  2210.       \dumpinsertseject
  2211.       \setpagenumber{\E}
  2212.       \immediate\closeout\TC*fa
  2213.       \begingroup
  2214.       \def\centerline##1{\par % Begin centerline markup
  2215.          \bgroup
  2216.          \parindent=0pt \relax           % zero indent
  2217.          \parfillskip=0pt plus1fil \relax
  2218.          \everypar{\null\hskip0pt plus1fil\relax} % add infinite glue
  2219.          \def\linebreak{\hskip0pt plus1fil\relax\break
  2220.                         \null\hskip0pt plus1fil\relax}%
  2221.          \let\toclinebreak=\linebreak  % linebreak is a space in text1$$.
  2222.          \let\toclbr=\linebreak        % toc1, toclbr available in toc
  2223.          \justify
  2224.          \setbox\A=\vbox{##1\par % figure skip for multiple centerline
  2225.                          \global\C=\baselineskip
  2226.                          \setbox0=\hbox{(}
  2227.                          \global\advance\C by-\ht0}% end vbox
  2228.       \line{\hss\vbox{\vskip\C##1\par}\hss} %
  2229.          \egroup
  2230.       }% End centerline markup
  2231.       \let\cl=\centerline
  2232.       \justify
  2233.       \parfillskip=0pt
  2234.       \rightskip=0pt plus 5em
  2235.       \input text1$$.tc1
  2236.       \endgraf
  2237.       \leftskip=0pt
  2238.       \if*TCbopen     % True only if figures were used.
  2239.                    \immediate\closeout\TC*fb
  2240.                    \input text1$$.tc2
  2241.                    \fi
  2242.       \if*TCcopen     % True only if tables were used.
  2243.                    \immediate\closeout\TC*fc
  2244.                    \input text1$$.tc3
  2245.                    \fi
  2246.       \endgroup}
  2247. \let\toc=\tableofcontents
  2248. %
  2249. \long\def\partformat#1{{%
  2250.       \def\numberingstyle##1{\global\*pt*st=1
  2251.               \edef\T{##1}%
  2252.               \edef\U{1}%
  2253.               \edef\V{A}%
  2254.               \edef\W{I}%
  2255.               \ifx \T\U     % then style=1, the default
  2256.                    \else \ifx \T\V \global\*pt*st=2
  2257.                          \else \ifx \T\W \global\*pt*st=3
  2258.                                \else \message{<TEXT1> Warning, numbering style
  2259.                                               in the partformat command is
  2260.                                               invalid. Style 1 will be assumed.}
  2261.                    \fi\fi\fi}%
  2262.       \long\def\titleformat##1{\global\*partt={##1}}%
  2263.       \def\incontents##1{\global\*TC*prttrue
  2264.             \edef\T{##1}%
  2265.             \edef\U{yes}%
  2266.             \edef\V{no}%
  2267.             \ifx \T\U              % Already true
  2268.                  \else \ifx \T\V \global\*TC*prtfalse
  2269.                        \else \message{<TEXT1> Warning, argument to
  2270.                                       incontents in partformat is not "yes" or "no".
  2271.                                       "yes" will be assumed.}
  2272.                  \fi\fi}%
  2273.     #1}}
  2274. \let\paf=\partformat
  2275. %
  2276. \def\parttitle{}
  2277. \def\part#1{\par % Part revised 11/5/86
  2278.     \global\def\parttitle{#1}%
  2279.     \global\advance \*pt*num by 1
  2280.     \bgroup
  2281.        \let\toclinebreak=\space      % prevent linebreak in title
  2282.        \let\toclbr=\space            % break in contents only
  2283.        \the\*partt                   % This prints the title in the text
  2284.     \egroup
  2285.     \par
  2286. \if*TC*prt \putincontents1{\the\*ptf}\fi
  2287. \ignorespaces}% END
  2288. %
  2289. \def\partnumber{{\ifcase \*pt*st
  2290.                     \or \the\*pt*num
  2291.                     \or \l*alphafalse
  2292.                         \a*c{\*pt*num}
  2293.                     \or \uppercase\expandafter{\romannumeral\the\*pt*num}
  2294.                     \fi}}
  2295. %
  2296. \def\setpartnumber#1{\global\*pt*num=#1}%
  2297. % \spn is setpagenumber
  2298. \let\sptn=\setpartnumber
  2299. %
  2300. \long\def\chapterformat#1{{%
  2301.       \def\numberingstyle##1{\global\*ch*st=1
  2302.               \edef\T{##1}%
  2303.               \edef\U{1}%
  2304.               \edef\V{A}%
  2305.               \edef\W{I}%
  2306.               \ifx \T\U     % then style=1, the default
  2307.                    \else \ifx \T\V \global\*ch*st=2
  2308.                          \else \ifx \T\W \global\*ch*st=3
  2309.                                \else \message{<TEXT1> Warning, numbering style
  2310.                                               in the chapterformat command is
  2311.                                               invalid. Style 1 will be assumed.}
  2312.                    \fi\fi\fi}%
  2313.       \long\def\titleformat##1{\global\*chapt={##1}}%
  2314.       \def\incontents##1{\global\*TC*chptrue%
  2315.             \edef\T{##1}%
  2316.             \edef\U{yes}%
  2317.             \edef\V{no}%
  2318.             \ifx \T\U              % Already true
  2319.                  \else \ifx \T\V \global\*TC*chpfalse
  2320.                        \else \message{<TEXT1> Warning, argument to
  2321.                                       incontents in chapterformat is not "yes" or "no".
  2322.                                       "yes" will be assumed.}
  2323.                  \fi\fi}%
  2324.     #1}}
  2325. \let\chf=\chapterformat
  2326. %
  2327. \def\chaptertitle{}
  2328. \def\chapter#1{\par % Chapter revision 11/3/86 (added toclinebreak)
  2329.     \global\def\chaptertitle{#1}%
  2330.     \global\advance \*ch*num by 1
  2331.     \bgroup
  2332.        \let\toclinebreak=\space
  2333.        \let\toclbr=\space
  2334.        \the\*chapt                   % prints the title in the text
  2335.     \egroup
  2336.     \if*TC*chp \putincontents1{\the\*ctf}\fi
  2337. \ignorespaces}% END chapter markup definition
  2338. %
  2339. \def\chapternumber{{\ifcase \*ch*st
  2340.                        \or \the\*ch*num
  2341.                        \or \l*alphafalse
  2342.                            \a*c{\*ch*num}
  2343.                        \or \uppercase\expandafter{\romannumeral\the\*ch*num}
  2344.                        \fi
  2345.                     \removelastskip}}
  2346. \let\chap=\chapter
  2347. %
  2348. \def\hangingchapternumber#1{\*ch*num=#1\laf{\labelwidth{\*ch*hi}}
  2349.     \label{\hskip\*ch*hi\llap{\chapternumber.}}}
  2350. %
  2351. \def\setchapternumber#1{\global\*ch*num=#1}%
  2352. \let\scn=\setchapternumber
  2353. %
  2354. \long\def\appendixformat#1{{%
  2355.       \def\numberingstyle##1{\global\*ap*st=2
  2356.               \edef\T{##1}%
  2357.               \edef\U{1}%
  2358.               \edef\V{A}%
  2359.               \edef\W{I}%
  2360.               \ifx \T\U \global\*ap*st=1
  2361.                    \else \ifx \T\V \global\*ap*st=2
  2362.                          \else \ifx \T\W \global\*ap*st=3
  2363.                                \else \message{<TEXT1> Warning, numbering style
  2364.                                               in the appendixformat command is
  2365.                                               invalid. Style 2 will be assumed.}
  2366.                    \fi\fi\fi}%
  2367.       \long\def\titleformat##1{\global\*appt={##1}}%
  2368.       \def\incontents##1{\global\*TC*apptrue
  2369.             \edef\T{##1}%
  2370.             \edef\U{yes}%
  2371.             \edef\V{no}%
  2372.             \ifx \T\U              % Already true
  2373.                  \else \ifx \T\V \global\*TC*appfalse
  2374.                        \else \message{<TEXT1> Warning, argument to
  2375.                                       incontents in appendixformat is not "yes" or "no".
  2376.                                       "yes" will be assumed.}
  2377.                  \fi\fi}%
  2378.     #1}}
  2379. \let\apf=\appendixformat
  2380. %
  2381. \def\appendixtitle{}
  2382. \def\appendix#1{% Appendix revised 11/3/86 (added toclinebreak)
  2383.     \global\def\appendixtitle{#1}%
  2384.     \global\advance \*ap*num by 1
  2385.     \par
  2386.     \bgroup
  2387.        \let\toclinebreak=\space
  2388.        \let\toclbr=\space
  2389.        \the\*appt                    % prints the appendix title
  2390.     \egroup
  2391.     \if*TC*app \putincontents1{\the\*atf}\fi
  2392. \ignorespaces}% END appendix markup definition
  2393. %
  2394. \def\appendixnumber{{\ifcase \*ap*st
  2395.                        \or \the\*ap*num
  2396.                        \or \l*alphafalse
  2397.                            \a*c{\*ap*num}
  2398.                        \or \uppercase\expandafter{\romannumeral\the\*ap*num}
  2399.                        \fi
  2400.                      \removelastskip}}
  2401. \let\app=\appendix
  2402. %
  2403. \def\hangingappendixnumber#1{\*ap*num=#1\laf{\labelwidth{\*ap*hi}}
  2404.     \label{\hskip\*ap*hi\llap{\appendixnumber.}}}
  2405. %
  2406. \def\setappendixnumber#1{\global\*ap*num=#1}%
  2407. \let\san=\setappendixnumber
  2408. %
  2409. \long\def\prefaceformat#1{{%
  2410.       \long\def\titleformat##1{\global\*pret={##1}}%
  2411.       \def\incontents##1{\global\*TC*pretrue
  2412.             \edef\T{##1}%
  2413.             \edef\U{yes}%
  2414.             \edef\V{no}%
  2415.             \ifx \T\U              % Already true
  2416.                  \else \ifx \T\V \global\*TC*prefalse
  2417.                        \else \message{<TEXT1> Warning, argument to
  2418.                                       incontents in prefaceformat is not "yes" or "no".
  2419.                                       "yes" will be assumed.}
  2420.                  \fi\fi}%
  2421.     #1}}
  2422. \let\prf=\prefaceformat
  2423. %
  2424. \def\prefacetitle{}
  2425. \def\preface#1{% Preface revised 11/3/86 (added toclinebreak)
  2426.     \global\def\prefacetitle{#1}%
  2427.     \par
  2428.     \bgroup
  2429.        \let\toclinebreak=\space
  2430.        \let\toclbr=\space
  2431.        \the\*pret                    % prints the title in the text
  2432.     \egroup
  2433.     \if*TC*pre \putincontents1{\the\*prtf}\fi
  2434. \ignorespaces}% END preface markup definition
  2435. \let\pre=\preface
  2436. %
  2437. \long\def\subheadaformat#1{{%
  2438.       \def\numberingstyle##1{\global\sa*st=1
  2439.               \edef\T{##1}%
  2440.               \edef\U{1}%
  2441.               \edef\V{A}%
  2442.               \edef\W{I}%
  2443.               \ifx \T\U     % then style=1, the default
  2444.                    \else \ifx \T\V \global\sa*st=2
  2445.                          \else \ifx \T\W \global\sa*st=3
  2446.                                \else \message{<TEXT1> Warning, numbering style
  2447.                                               in the subheadaformat command is
  2448.                                               invalid. Style 1 will be assumed.}
  2449.                    \fi\fi\fi}%
  2450.       \long\def\titleformat##1{\global\*subat={##1}}%
  2451.       \def\incontents##1{\global\*TC*shatrue
  2452.             \edef\T{##1}%
  2453.             \edef\U{yes}%
  2454.             \edef\V{no}%
  2455.             \ifx \T\U              % Already true
  2456.                  \else \ifx \T\V \global\*TC*shafalse
  2457.                        \else \message{<TEXT1> Warning, argument to
  2458.                                       incontents in subheadaformat is not "yes" or "no".
  2459.                                       "yes" will be assumed.}
  2460.                  \fi\fi}%
  2461.     #1}}
  2462. \let\shaf=\subheadaformat
  2463. %
  2464. \def\subheadatitle{}
  2465. \def\subheada#1{% Subheada revised 11/3/86 (added toclinebreak)
  2466.     \global\def\subheadatitle{#1}%
  2467.     \global\advance \*sa*num by 1
  2468.     \par
  2469.     \bgroup
  2470.        \let\toclinebreak=\space
  2471.        \let\toclbr=\space
  2472.        \the\*subat                    %  prints the title in the text
  2473.     \egroup
  2474.     \if*TC*sha \putincontents1{\the\*satf}\fi
  2475.     \ignorespaces}% END subheada markup definition
  2476. %
  2477. \def\subheadanumber{{\ifcase \sa*st
  2478.                        \or \the\*sa*num
  2479.                        \or \l*alphafalse
  2480.                            \a*c{\*sa*num}
  2481.                        \or \uppercase\expandafter{\romannumeral\the\*sa*num}
  2482.                        \fi
  2483.                      \removelastskip}}
  2484. \let\sha=\subheada
  2485. %
  2486. \def\setsubheadanumber#1{\global\*sa*num=#1}%
  2487. \let\ssan=\setsubheadanumber
  2488. %
  2489. \long\def\subheadbformat#1{{%
  2490.       \def\numberingstyle##1{\global\sb*st=1
  2491.               \edef\T{##1}%
  2492.               \edef\U{1}%
  2493.               \edef\V{A}%
  2494.               \edef\W{I}%
  2495.               \ifx \T\U     % then style=1, the default
  2496.                    \else \ifx \T\V \global\sb*st=2
  2497.                          \else \ifx \T\W \global\sb*st=3
  2498.                                \else \message{<TEXT1> Warning, numbering style
  2499.                                               in the subheadbformat command is
  2500.                                               invalid. Style 1 will be assumed.}
  2501.                    \fi\fi\fi}%
  2502.       \long\def\titleformat##1{\global\*subbt={##1}}%
  2503.       \def\incontents##1{\global\*TC*shbtrue
  2504.             \edef\T{##1}%
  2505.             \edef\U{yes}%
  2506.             \edef\V{no}%
  2507.             \ifx \T\U              % Already true
  2508.                  \else \ifx \T\V \global\*TC*shbfalse
  2509.                        \else \message{<TEXT1> Warning, argument to
  2510.                                       incontents in subheadbformat is not "yes" or "no".
  2511.                                       "yes" will be assumed.}
  2512.                  \fi\fi}%
  2513.     #1}}
  2514. \let\shbf=\subheadbformat
  2515. %
  2516. \def\subheadbtitle{}
  2517. \def\subheadb#1{% Subheadb revised 11/3/86 (added toclinebreak)
  2518.     \global\def\subheadbtitle{#1}%
  2519.     \global\advance \*sb*num by 1
  2520.     \par
  2521.     \bgroup
  2522.        \let\toclinebreak=\space
  2523.        \let\toclbr=\space
  2524.        \the\*subbt                   % This  prints the title in the text
  2525.     \egroup
  2526.     \if*TC*shb \putincontents1{\the\*sbtf}\fi
  2527.     \ignorespaces}% END subheadb markup definition
  2528. %
  2529. \def\subheadbnumber{{\ifcase \sb*st
  2530.                        \or \the\*sb*num
  2531.                        \or \l*alphafalse
  2532.                            \a*c{\*sb*num}
  2533.                        \or \uppercase\expandafter{\romannumeral\the\*sb*num}
  2534.                        \fi
  2535.                      \removelastskip}}
  2536. \let\shb=\subheadb
  2537. %
  2538. \def\setsubheadbnumber#1{\global\*sb*num=#1}%
  2539. \let\ssbn=\setsubheadbnumber
  2540. %
  2541. \long\def\subheadcformat#1{{%
  2542.       \def\numberingstyle##1{\global\sc*st=1
  2543.               \edef\T{##1}%
  2544.               \edef\U{1}%
  2545.               \edef\V{A}%
  2546.               \edef\W{I}%
  2547.               \ifx \T\U     % then style=1, the default
  2548.                    \else \ifx \T\V \global\sc*st=2
  2549.                          \else \ifx \T\W \global\sc*st=3
  2550.                                \else \message{<TEXT1> Warning, numbering style
  2551.                                               in the subheadcformat command is
  2552.                                               invalid. Style 1 will be assumed.}
  2553.                    \fi\fi\fi}%
  2554.       \long\def\titleformat##1{\global\*subct={##1}}
  2555.       \def\incontents##1{\global\*TC*shcfalse
  2556.             \edef\T{##1}%
  2557.             \edef\U{yes}%
  2558.             \edef\V{no}%
  2559.             \ifx \T\U \global\*TC*shctrue
  2560.                  \else \ifx \T\V \global\*TC*shcfalse
  2561.                        \else \message{<TEXT1> Warning, argument to
  2562.                                       incontents in subheadcformat is not "yes" or "no".
  2563.                                       "no" will be assumed.}
  2564.                  \fi\fi}%
  2565.     #1}}
  2566. \let\shcf=\subheadcformat
  2567. %
  2568. \def\subheadctitle{}
  2569. \def\subheadc#1{% Subheadc revised 11/3/86 (added toclinebreak)
  2570.     \global\def\subheadctitle{#1}%
  2571.     \global\advance \*sc*num by 1
  2572.     \par
  2573.     \bgroup
  2574.        \let\toclinebreak=\space
  2575.        \let\toclbr=\space
  2576.       \the\*subct                    % prints the title in the text
  2577.     \egroup
  2578.     \if*TC*shc \putincontents1{\the\*sctf}\fi
  2579.     \ignorespaces}% END subheadc markup
  2580. %
  2581. \def\subheadcnumber{{\ifcase \sc*st
  2582.                        \or \the\*sc*num
  2583.                        \or \l*alphafalse
  2584.                            \a*c{\*sc*num}
  2585.                        \or \uppercase\expandafter{\romannumeral\the\*sc*num}
  2586.                        \fi
  2587.                      \removelastskip}}
  2588. \let\shc=\subheadc
  2589. %
  2590. \def\setsubheadcnumber#1{\global\*sc*num=#1}%
  2591. \let\sscn=\setsubheadcnumber
  2592. %
  2593. \long\def\subheaddformat#1{{%
  2594.       \def\numberingstyle##1{\global\sd*st=1
  2595.               \edef\T{##1}%
  2596.               \edef\U{1}%
  2597.               \edef\V{A}%
  2598.               \edef\W{I}%
  2599.               \ifx \T\U     % then style=1, the default
  2600.                    \else \ifx \T\V \global\sd*st=2
  2601.                          \else \ifx \T\W \global\sd*st=3
  2602.                                \else \message{<TEXT1> Warning, numbering style
  2603.                                               in the subheaddformat command is
  2604.                                               invalid. Style 1 will be assumed.}
  2605.                    \fi\fi\fi}%
  2606.       \long\def\titleformat##1{\global\*subdt={##1}}%
  2607.       \def\incontents##1{\global\*TC*shdfalse
  2608.             \edef\T{##1}%
  2609.             \edef\U{yes}%
  2610.             \edef\V{no}%
  2611.             \ifx \T\U \global\*TC*shdtrue
  2612.                  \else \ifx \T\V \global\*TC*shdfalse
  2613.                        \else \message{<TEXT1> Warning, argument to
  2614.                                       incontents in subheaddformat is not "yes" or "no".
  2615.                                       "no" will be assumed.}
  2616.                  \fi\fi}%
  2617.     #1}}
  2618. \let\shdf=\subheaddformat
  2619. %
  2620. \def\subheaddtitle{}
  2621. \def\subheadd#1{% Subheadd revised 11/3/86 (added toclinebreak)
  2622.     \global\def\subheaddtitle{#1}%
  2623.     \global\advance \*sd*num by 1
  2624.     \par
  2625.     \bgroup
  2626.        \let\toclinebreak=\space
  2627.        \let\toclbr=\space
  2628.        \the\*subdt                   % This  prints the title in the text
  2629.     \egroup
  2630.     \if*TC*shd \putincontents1{\the\*sdtf}\fi
  2631.     \ignorespaces}% END subheadd markup definition
  2632. %
  2633. \def\subheaddnumber{{\ifcase \sd*st
  2634.                        \or \the\*sd*num
  2635.                        \or \l*alphafalse
  2636.                            \a*c{\*sd*num}
  2637.                        \or \uppercase\expandafter{\romannumeral\the\*sd*num}
  2638.                        \fi
  2639.                      \removelastskip}}
  2640. \let\shd=\subheadd
  2641. %
  2642. \def\setsubheaddnumber#1{\global\*sd*num=#1}%
  2643. \let\ssdn=\setsubheaddnumber
  2644. %
  2645. %                       FIGURE MARKUP, bth 8/25/86
  2646. % Figure altered to allow alignments and other text markups within the
  2647. % arguments of figure and allow the immediate print feature (nofloat).
  2648. % Footnoting and multiple columns allowed in nofloat format only.
  2649. % Floating figures use top insert which uses a vbox that cancels any
  2650. % footnoting or multiple column setting. When \fullpage or \halfpage
  2651. % are used they must be the only argument in position one.
  2652. %
  2653. %
  2654. %              Figureformat revised on 4/5/88, drg
  2655. %
  2656. \catcode`* = 11
  2657. \catcode`@ = 11
  2658. \newif\if*fp \*fpfalse               % fullpage, used in figure
  2659. \newif\if*hp \*hpfalse               % halfpage, "            "
  2660. \newcount\fi*pos \fi*pos=1           % 1=\float,2=\nofloat,3=\midfloat,4=\keep
  2661. \newtoks\fi*sb     \fi*sb={1\bl}
  2662. \newtoks\fi*sa     \fi*sa={1\bl}
  2663. \def\figureformat#1{{%
  2664.     \def\skipbefore##1{\global\fi*sb={##1}}%
  2665.     \def\position{% printing position of figure, floating or nonfloating
  2666.         \def\nofloat{\global\fi*pos=2} % prints immediate
  2667.         \def\keep{\global\fi*pos=4}    % prints immediate, but on same pg
  2668.         \def\midfloat{\global\fi*pos=3}% uses midinsert
  2669.         \def\float{\global\fi*pos=1}}  % uses topinsert, the default
  2670.     \long\def\titleformat##1{\global\*figt={##1}}%
  2671.     \def\incontents##1{\global\*TC*figtrue
  2672.         \edef\T{##1}%
  2673.         \edef\U{yes}%
  2674.         \edef\V{no}%
  2675.         \ifx \T\U                % Already true
  2676.         \else \ifx \T\V \global\*TC*figfalse
  2677.               \else \message{<TEXT1> Warning, argument to
  2678.                      incontents in figureformat is not "yes" or "no".
  2679.                                       "yes" will be assumed.}
  2680.                  \fi\fi}%
  2681.     \def\skipafter##1{\global\fi*sa={##1}}%
  2682.     #1}}% End figure format markup
  2683. \let\fif=\figureformat
  2684. %
  2685. \newif\if*tpreset                    % titlepage reset for figure markup
  2686. \*tpresetfalse                       % no reset necessary
  2687. %
  2688. %    Figure revised on 10/4/89, drg
  2689. %
  2690. \def\figuretitle{}
  2691. \def\figure{\futurelet\next\*fga}
  2692. \def\*fga{\ifcat\bgroup\noexpand\next \let\next\*fgb
  2693.     \else\let\next\*fgc\fi \next}
  2694. \def\*fgb{\global\setbox\A=\vbox\bgroup\aftergroup\*fgd\let\next}
  2695. \def\*fgc#1{\*fge{#1}}
  2696. \def\*fgd{\*fge{\box\A}}
  2697. \long\def\*fge#1#2{\par % Begin figure markup definition
  2698.     \gdef\figuretitle{#2}%
  2699.     \global\advance \fi*n by 1       % figure number
  2700.     \begingroup                      % trap null setting for lets
  2701.     \let\fullpage=\null              % make fullpage non-printable
  2702.     \let\halfpage=\null              % make halfpage non-printable
  2703.     \let\toclinebreak=\space         % prevent break in title
  2704.     \let\toclbr=\space               % prevent break in title
  2705. %      for value of \fi*pos: 1=\float,2=\nofloat,3=\midfloat,4=\keep
  2706.     \ifcase\fi*pos
  2707.       \or                            % BEGIN TOPINSERT FIGURES
  2708.        \if*fp                        % full page topinsert figure
  2709.           \if*title\*tpresettrue\notitlepage\fi % account for titlepage
  2710.           \topinsert                 % floating figures are topinserts
  2711.           \if*TC*fig \putincontents2{\the\*ftf}\fi
  2712.           \vbox to\vsize{\vrule width0pt\relax
  2713.              \vfil#1\the\*figt}
  2714.           \endinsert
  2715.           \if*tpreset\titlepage\*tpresetfalse\fi % reset titlepage
  2716.        \else\if*hp                   % half page topinsert figure
  2717.                \topinsert
  2718.                \if*TC*fig \putincontents2{\the\*ftf}\fi
  2719.                \vbox to.5\vsize{\vrule width0pt \relax
  2720.                    \vskip\the\fi*sb\relax
  2721.                     \vfil#1\the\*figt
  2722.                     \vskip\the\fi*sa\relax}
  2723.                \endinsert
  2724.                    \else              % variable size floating figure
  2725.                       \topinsert
  2726.                       \if*TC*fig \putincontents2{\the\*ftf}\fi
  2727.                       \vskip\the\fi*sb\relax
  2728.                       #1\the\*figt
  2729.                       \vskip\the\fi*sa\relax
  2730.                       \endinsert
  2731.        \fi\fi                        % end float full and half page check
  2732.       \or                            % BEGIN IMMEDIATE FIGURES
  2733.        \if*fp                        % FULL PAGE IMMEDIATE FIGURE
  2734.           \np                        % figure won't fit on current page
  2735.           \if*TC*fig \putincontents2{\the\*ftf}\fi % send to contents
  2736.           \vrule width0pt \relax     % prevent fil from going away
  2737.           \vfill\the\*figt           % fill to figure title
  2738.           \break                     % insures break at end of insert
  2739.        \else
  2740.           \if*hp                     % HALF PAGE IMMEDIATE FIGURE
  2741.              \dimen\D=.5\vsize       % depth check for half page figure
  2742.              \advance\dimen\D by\topskip % add topskip to .5 vsize
  2743.              \ifdim\pagetotal>\dimen\D\np\fi % won't fit on current page
  2744.              \vbox to.49\vsize{\vrule width0pt % keep skip
  2745.                 \vfil\relax          % skip all but title height to
  2746.                 #1\the\*figt         % print figure title
  2747.                 \vskip\the\fi*sa\relax} % print half page figure title
  2748.              \if*TC*fig \putincontents2{\the\*ftf}\fi
  2749.           \else                      % VARIABLE SIZE IMMEDIATE FIGURE
  2750.              \vrule width0pt \relax  % prevent skip from going away
  2751.              \vskip\the\fi*sb\relax
  2752.              #1\the\*figt
  2753.              \vskip\the\fi*sa\relax
  2754.              \if*TC*fig \putincontents2{\the\*ftf}\fi
  2755.              \fi% End of check at half page
  2756.        \fi          % End of check at full page
  2757.       \or                            % BEGIN MIDINSERT FIGURES
  2758.        \if*fp                        % full page midinsert figure
  2759.           \if*title\*tpresettrue\notitlepage\fi % account for titlepage
  2760.           \topinsert                 % use topinsert for full page only
  2761.           \if*TC*fig \putincontents2{\the\*ftf}\fi
  2762.           \vbox to\vsize{\vrule width0pt\relax
  2763.              \vfil#1\the\*figt}
  2764.           \endinsert
  2765.           \if*tpreset\titlepage\*tpresetfalse\fi % reset titlepage
  2766.        \else\if*hp                   % half page midinsert figure
  2767.                \midinsert
  2768.                \if*TC*fig \putincontents2{\the\*ftf}\fi
  2769.                \vbox to.5\vsize{\vrule width0pt \relax
  2770.                    \vskip\the\fi*sb\relax
  2771.                     \vfil#1\the\*figt
  2772.                     \vskip\the\fi*sa\relax}
  2773.                \endinsert
  2774.                    \else              % variable size floating figure
  2775.                       \midinsert
  2776.                       \if*TC*fig \putincontents2{\the\*ftf}\fi
  2777.                       \vskip\the\fi*sb\relax
  2778.                       #1\the\*figt
  2779.                       \vskip\the\fi*sa\relax
  2780.                       \endinsert
  2781.        \fi\fi                        % end float full and half page check
  2782.       \or                            % BEGIN IMMEDIATE KEEP FIGURES
  2783.        \if*fp                        % FULL PAGE IMMEDIATE FIGURE
  2784.           \np                        % figure won't fit on current page
  2785.           \if*TC*fig \putincontents2{\the\*ftf}\fi % send to contents
  2786.           \vrule width0pt \relax     % prevent fil from going away
  2787.           \vfill\the\*figt           % fill to figure title
  2788.           \break                     % insures break at end of insert
  2789.        \else
  2790.           \if*hp                     % HALF PAGE IMMEDIATE FIGURE
  2791.              \dimen\D=.5\vsize       % depth check for half page figure
  2792.              \advance\dimen\D by\topskip % add topskip to .5 vsize
  2793.              \ifdim\pagetotal>\dimen\D\np\fi % won't fit on current page
  2794.              \vbox to.49\vsize{\vrule width0pt % keep skip
  2795.                 \vfil\relax          % skip all but title height to
  2796.                 #1\the\*figt         % print figure title
  2797.                 \vskip\the\fi*sa\relax} % print half page figure title
  2798.              \if*TC*fig \putincontents2{\the\*ftf}\fi
  2799.           \else                      % VARIABLE SIZE IMMEDIATE FIGURE
  2800.              \vrule width0pt \relax  % prevent skip from going away
  2801.              \vskip\the\fi*sb\relax
  2802.              \vbox{#1\the\*figt
  2803.              \vskip\the\fi*sa\relax}
  2804.              \if*TC*fig \putincontents2{\the\*ftf}\fi
  2805.              \fi% End of check at half page
  2806.        \fi          % End of check at full page
  2807.        \fi          % End of case statement
  2808.     \endgroup                        % end trap for null settings
  2809.     \global\*fpfalse                        % reset full page
  2810.     \global\*hpfalse                        % reset half page
  2811. }% End figure markup
  2812. \let\fig=\figure                     % abbreviation for figure markup
  2813. %
  2814. \def\fullpage{\global\*fptrue}%               used in figure markup
  2815. \def\halfpage{\global\*hptrue}%               used in figure markup
  2816. %
  2817. \def\figurenumber{\the\fi*n}%
  2818. %
  2819. \def\HFN#1{\laf{\labelwidth{\fi*hi}}\label{#1}}%
  2820. %
  2821. \def\setfigurenumber#1{\global\fi*n=#1}%
  2822. \let\sfn=\setfigurenumber
  2823. %
  2824. %      Redefined from PLAIN TEX
  2825. %
  2826. \def\topinsert{\@midfalse\p@gefalse\t*ptrue\@ins}
  2827. %
  2828. \def\midinsert{%                       redefine from plain tex
  2829.     \@midtrue
  2830.     \if*fix %                          don't change meaning in fixed mode
  2831.     \else %                         change midinsert to topinsert in flex mode
  2832.        \if*dbl\global\@midfalse\fi % leave old meaning in single column mode
  2833.        \if*tpl\global\@midfalse\fi %
  2834.     \fi\@ins} %
  2835. %
  2836. \def\@ins{\par\begingroup
  2837.     \if*fix                          % do nothing in fixed mode
  2838.     \else\ift*p\hsize=\*txtw\fi\fi   % ift*p hsize of insert set
  2839.     \setbox0=\vbox\bgroup}           % insert set to full page width
  2840. %
  2841. %        Tables
  2842. %
  2843. \def\tableformat#1{{%
  2844.       \long\def\titleformat##1{\global\*tabt={##1}}%
  2845.       \def\incontents##1{\global\*TC*tabtrue
  2846.             \edef\T{##1}%
  2847.             \edef\U{yes}%
  2848.             \edef\V{no}%
  2849.             \ifx \T\U                % Already true
  2850.                  \else \ifx \T\V \global\*TC*tabfalse
  2851.                        \else \message{<TEXT1> Warning, argument to
  2852.                                       incontents in tableformat is not "yes" or "no".
  2853.                                       "yes" will be assumed.}
  2854.                  \fi\fi}%
  2855.     #1}}
  2856. \let\taf=\tableformat
  2857. %
  2858. \def\tabletitle#1{{% Tabletitle revised 11/3/86 (added toclinebreak)
  2859.     \def\tabletitle{#1}%
  2860.     \global\advance \ta*n by 1
  2861.     \par
  2862.     \bgroup
  2863.        \let\toclinebreak=\space
  2864.        \let\toclbr=\space
  2865.        \the\*tabt                    % prints the title in the text
  2866.     \egroup
  2867.     \par
  2868.     \if*TC*tab \putincontents3{\the\*ttf}\fi
  2869. }}% END tabletitle markup definition
  2870. \let\tat=\tabletitle
  2871. %
  2872. \def\tablenumber{\the\ta*n}
  2873. \def\HTN#1{\laf{\labelwidth{\ta*hi}}\label{#1}}
  2874. %
  2875. \def\settablenumber#1{\global\ta*n=#1}%
  2876. \let\stn=\settablenumber
  2877. %
  2878. %    The \gutter macro is actually used for several macros, \bul, \lil, etc.
  2879. %
  2880. \newdimen\*gut
  2881. \def\gutter#1{\*gut=#1}
  2882. %     End of the Item macros (DRG)
  2883. %
  2884. %     Macros specific for the 8600 (JKW) revision 11/25/86
  2885. %
  2886. \newskip\evenmar
  2887. \newskip\oddmar
  2888. \evenmar=0pt
  2889. \oddmar=0pt
  2890. \def\evenpagemargin#1{{\setbox0=\hbox{\global\evenmar=#1 pt}}
  2891.                       \special{even_page_margin=\the\evenmar}}%
  2892. \let\epm=\evenpagemargin
  2893. \def\oddpagemargin#1{{\setbox0=\hbox{\global\oddmar=#1 pt}}
  2894.                      \special{odd_page_margin=\the\oddmar}}%
  2895. \let\opm=\oddpagemargin
  2896. \def\linenumberfont#1{\B={#1}
  2897.                       \special{line_number_font=\the\B}}%
  2898. \let\lnf=\linenumberfont
  2899. \def\poplevel#1{\B={#1}
  2900.                 \special{pop_level=\the\B}}%
  2901. \let\ppl=\poplevel
  2902. \def\lineinterval#1{\B={#1}
  2903.                     \special{line_interval=\the\B}}%
  2904. \let\lint=\lineinterval
  2905. \def\numberinglines#1{\special{numbering_lines=#1}}%
  2906. \let\numl=\numberinglines
  2907. \def\countinglines#1{\special{counting_lines=#1}}%
  2908. \let\coul=\countinglines
  2909. \def\printingnumbers#1{\special{printing_numbers=#1}}%
  2910. \let\prin=\printingnumbers
  2911. \def\linefootnotereference{\special{line_footnote_reference}}%
  2912. \let\lfnr=\linefootnotereference
  2913. %
  2914. %     To be able to use PLAIN.TEX math code
  2915. %
  2916. \def\plaintexmathon{%
  2917.    \catcode`\$=3\relax
  2918.    \catcode`@=12\relax}
  2919. \let\dollarmathon=\plaintexmathon
  2920. \def\atmathon{%
  2921.    \catcode`\$=12\relax
  2922.    \catcode`@=3\par}
  2923. %
  2924. \outer\def\bye{\par\onecolumn\vfill\supereject\end} % redefined from PLAIN.TEX
  2925. %                                      to close multiple column routines
  2926. %
  2927. %          MULTIPLE COLUMNS
  2928. %          Brian Harvey 1/20/85
  2929. %
  2930. %     Macros to be imbedded into TEXT1@@ to drive the multiple column
  2931. %     routines FLEXC@L and FIXC@L.
  2932. %
  2933. \newbox\*lftcol                      % left column box, fixed column mode, TeXbook name
  2934. \newbox\*midcol                      % center column, fixed column mode, TeXbook name
  2935. \newbox\*ppage                       % page accummulated before multicolumn, partialpage, flex
  2936. \newcount\*pcount                    % counter for empty page macro, keeps track of the
  2937. \*pcount=0                           % number of empty page calls
  2938. \newdimen\*bigch                     % Twc=2vise, Thc=3vsize---bigcolumnheight
  2939. \newdimen\*txtw                      % textwidth, stores full hsize for multicolumn mode
  2940. \let\galleywidth=\*txtw              % create galleywidth = text width
  2941. \newdimen\*txth                      % textheight, stores page height for multicolumn mode
  2942. \*txtw=\hsize                        % initialize full page text width for multicolumn mode
  2943. \*txth=\vsize                        % initialize full text height for multicolumn mode
  2944. \newif\ift*p                         % ift*p required to check for midinsert in flex mode
  2945. \newif\if*dbl                        % double column indicator
  2946. \*dblfalse                           % set double column format indicator false
  2947. \newif\if*tpl                        % triple column indicator
  2948. \*tplfalse                           % set triple column format indicator false
  2949. \newif\if*fix                        % format indicator (fixed if true, otherwise flexible)
  2950. \newif\if*norule                     % used to suppress rules in output routines
  2951. \newif\if*plain                      % check for plain.tex, plainoutput
  2952. \*plaintrue                          % set plain format indicator true
  2953. \newtoks\*twcw                       % width for twocolumns
  2954. \newtoks\*thcw                       % width for threecolumns
  2955. \newtoks\*twcgut                     % gutter for twocolumns
  2956. \newtoks\*thcgut                     % gutter for threecolumns
  2957. \newtoks\*clrw                       % rule width between multiple columns
  2958. \newtoks\*mskb                       % skip before multicolumn format
  2959. \newtoks\*mska                       % skip after multicolumn format
  2960. \*twcw={.48\*txtw}                   % initialize column and gutter default widths
  2961. \*thcw={.31\*txtw}
  2962. \*twcgut={.04\*txtw}
  2963. \*thcgut={.035\*txtw}
  2964. \*clrw={0.0pt}                       % initialize between column rule width
  2965. \*mskb={6pt plus 3pt minus 2pt}      % initialize skips before and after multiple columns:
  2966. \*mska={6pt plus 3pt minus 2pt}      % used in multiple column flex mode only
  2967.  
  2968. \def\fixedformat{\global\*fixtrue}   % calls fixed format file
  2969. \let\fixf=\fixedformat
  2970. \global\*fixfalse                    % sets up flex format
  2971. %
  2972. \def\multicolumnformat#1{% format macro for both fixed and flexible, texblock is multicol
  2973.     \def\twocolumnwidth##1{\global\*twcw={##1}}%
  2974.     \def\threecolumnwidth##1{\global\*thcw={##1}}%
  2975.     \def\twocolumngutter##1{\global\*twcgut={##1}}%
  2976.     \def\threecolumngutter##1{\global\*thcgut={##1}}%
  2977.     \def\columnrulewidth##1{\global\*clrw={##1}}%
  2978.     \def\skipbefore##1{\global\*mskb={##1}}% flex mode only
  2979.     \def\skipafter##1{\global\*mska={##1}}% flex mode only
  2980.     #1\*txtwck}% END, multicol format
  2981. \let\mcf=\multicolumnformat
  2982. %
  2983. %          COLUMN WIDTH CHECK FOR MULTIPLE COLUMN ROUTINES
  2984. %
  2985. \def\*txtwck{% check column width and gutters against hsize
  2986.     \dimen@=\the\*twcw
  2987.     \dimen@=2\dimen@
  2988.     \dimen1=\the\*twcgut
  2989.     \advance\dimen@ by\dimen1
  2990.     \ifdim\dimen@ > \*txtw         % if greater than current pagewidth
  2991.        \dimen1=\dimen@
  2992.        \advance\dimen1 by-\*txtw
  2993.        \advance\dimen@ by -\*txtw
  2994.        \ifdim\dimen@ > 1pt % only warn if over 1pt
  2995.           \immediate\write16{%
  2996.           <TEXT1> Warning! The column and gutter widths specified%
  2997.           for two columns are wider than the current pagewidth by%
  2998.           \the\dimen1 . }
  2999.           \fi
  3000.     \else\ifdim\dimen@ < \*txtw   % if less than current pagewidth
  3001.        \dimen1=\*txtw
  3002.        \advance\dimen1 by-\dimen@
  3003.        \advance\dimen@ by -\*txtw
  3004.        \multiply\dimen@ by -1
  3005.        \ifdim\dimen@ > 1pt  % Only warn if over 1pt difference
  3006.           \immediate\write16{%
  3007.           <TEXT1> Warning! The column and gutter widths specified%
  3008.           for two columns are shorter than the current pagewidth by%
  3009.           \the\dimen1 . }
  3010.           \fi
  3011.        \fi\fi
  3012. %
  3013.     \dimen@=\the\*thcw               % width of each column, three columns
  3014.     \dimen@=3\dimen@                 % three columns
  3015.     \dimen1=\the\*thcgut             % width of the gutters
  3016.     \dimen1=2\dimen1                 % two gutters in three columns
  3017.     \advance\dimen@ by\dimen1        % add columns and gutters together
  3018.     \ifdim\dimen@ > \*txtw           % if greater than current pagewidth
  3019.        \dimen1=\dimen@
  3020.        \advance\dimen1 by-\*txtw
  3021.        \advance\dimen@ by -\*txtw
  3022.        \ifdim\dimen@ > 1pt % only warn if over 1pt
  3023.           \immediate\write16{%
  3024.           <TEXT1> Warning! The column and gutter widths specified%
  3025.           for three columns are wider than the current pagewidth by%
  3026.           \the\dimen1 . }
  3027.           \fi
  3028.     \else\ifdim\dimen@ < \*txtw   % if less than current pagewidth
  3029.        \dimen1=\*txtw
  3030.        \advance\dimen1 by-\dimen@
  3031.        \advance\dimen@ by -\*txtw
  3032.        \multiply\dimen@ by -1
  3033.        \ifdim\dimen@ > 1pt  % Only warn if over 1pt difference
  3034.           \immediate\write16{%
  3035.           <TEXT1> Warning! The column and gutter widths specified%
  3036.           for three columns are shorter than the current pagewidth by%
  3037.           \the\dimen1 . }
  3038.           \fi
  3039.        \fi\fi
  3040.     } % END, widthcheck
  3041. %
  3042. \newif\if*start*mc  \*start*mcfalse
  3043. \def\twocolumns{% TWOCOLUMNS set-up macro
  3044.     \if*fix \input fixcol            % input fixed format file
  3045.        \immediate\write-16{% write to log file only
  3046.        <TEXT1> Fixed format for multiple columns in effect. }
  3047.        \gdef\twocolumns{\*fixtwc}%     redefine twocolumns, fixed mode
  3048.        \gdef\threecolumns{\*fixthc}%   redefine threecolumns, fixed mode
  3049.     \else \input flexcol             % input flex format file
  3050.        \immediate\write-16{%           write to log file only
  3051.        <TEXT1> Flexible format for multiple columns in effect. }
  3052.        \gdef\twocolumns{\*flextwc}%    redefine twocolumns, flex mode
  3053.        \gdef\threecolumns{\*flexthc}\fi% redefine threecolumns, flex mode
  3054.    \twocolumns
  3055.    \global\let\twc=\twocolumns       % to current meaning of twocolumns
  3056.    \global\let\thc=\threecolumns     % to current meaning of threecolumns
  3057. }% END twocolumns markup
  3058. %
  3059. \let\twc=\twocolumns
  3060. %
  3061. \def\threecolumns{% THREECOLUMNS set-up macro
  3062.     \*start*mctrue
  3063.     \if*fix \input fixcol            % input fixed format file
  3064.        \immediate\write-16{%           write to log file only
  3065.        <TEXT1> Fixed format for multiple columns active. }
  3066.        \gdef\twocolumns{\*fixtwc}%     redefine twocolumns, fixed mode
  3067.        \gdef\threecolumns{\*fixthc}%   redefine threecolumns, fixed mode
  3068.     \else \input flexcol             % input flex format file
  3069.        \immediate\write-16{%           write to log file only
  3070.         <TEXT1> Flexible format for multiple columns active. }
  3071.        \gdef\twocolumns{\*flextwc}%    redefine twocolumns, flex mode
  3072.        \gdef\threecolumns{\*flexthc}\fi% redefine threecolumns, flex mode
  3073.    \threecolumns
  3074.    \global\let\twc=\twocolumns       % to current meaning of twocolumns
  3075.    \global\let\thc=\threecolumns     % to current meaning of threecolumns
  3076. }% End threecolumns markup
  3077. %
  3078. \let\thc=\threecolumns
  3079. %
  3080. \let\onecolumn=\null                 % Empty definition for single format
  3081. \let\oc=\onecolumn
  3082. %
  3083. \let\newcolumn=\newpage
  3084. \let\nc=\newpage
  3085. \newif\if*nc    \*ncfalse            % true if \nc was used in mult cols
  3086. %
  3087. \global
  3088. \newhelp\balerrhelp{onecolumn The best approach to solve this problem
  3089.     is to shorten the text by a line. You could also add or delete a
  3090.     paragraph or change the column size. }%
  3091. %
  3092. %                     Here are the macros necessary for doing an index
  3093. %
  3094. \newtoks\*ixarc     \*ixarc={case=no}                % IndeX A Respect Case
  3095. \newcount\*ixpn                                      % Page number type: 0,2,4,6, or 9
  3096. \newtoks\*ixast     \*ixast={style=3}                % IndeX A STyle
  3097. \newtoks\*ixald     \*ixald={leadering=no}           % IndeX A LeaDering
  3098. \newtoks\*ixabr     \*ixabr={\vs{1\bl}}              % IndeX A BReak
  3099. \newtoks\*ixasea    \*ixasea={1em}                   % IndeX A SubEntry 1
  3100. \newtoks\*ixaseb    \*ixaseb={2em}                   % IndeX A SubEntry   2
  3101. \newtoks\*ixaev     \*ixaev={\tenpt}          % Index A every time
  3102. \newtoks\*ixahp     \*ixahp={1.5em}                  % Index A hang indent
  3103. \newtoks\*ixbrc     \*ixbrc={case=no}                % IndeX B Respect Case
  3104. \newtoks\*ixbst     \*ixbst={style=3}                % IndeX B STyle
  3105. \newtoks\*ixbld     \*ixbld={leadering=no}           % IndeX B LeaDering
  3106. \newtoks\*ixbbr     \*ixbbr={\vs{1\bl}}              % IndeX B BReak
  3107. \newtoks\*ixbsea    \*ixbsea={1em}                   % IndeX B SubEntry 1
  3108. \newtoks\*ixbseb    \*ixbseb={2em}                   % IndeX B SubEntry 2
  3109. \newtoks\*ixbev     \*ixbev={\tenpt}          % Index B every time
  3110. \newtoks\*ixbhp     \*ixbhp={1.5em}                  % Index B hang indent
  3111. \newtoks\*ixcrc     \*ixcrc={case=no}                % IndeX C Respect Case
  3112. \newtoks\*ixcst     \*ixcst={style=3}                % IndeX C STyle
  3113. \newtoks\*ixcld     \*ixcld={leadering=no}           % IndeX C LeaDering
  3114. \newtoks\*ixcbr     \*ixcbr={\rule\vs{1\bl}}         % IndeX C BReak
  3115. \newtoks\*ixcsea    \*ixcsea={1em}                   % IndeX C SubEntry 1
  3116. \newtoks\*ixcseb    \*ixcseb={2em}                   % IndeX C SubEntry 2
  3117. \newtoks\*ixcev     \*ixcev={\tenpt}          % Index C every time
  3118. \newtoks\*ixchp     \*ixchp={1.5em}                  % Index C hang indent
  3119. %
  3120. \newcount\*ixlvl    \*ixlvl=1                        % IndeX LeVeL
  3121. %
  3122. \long\def\indexformat#1#2{{\ifnum #1>3 \message{<TEXT1> Error! Only three indices
  3123.                                         allowed. Level 1 will be used.}
  3124.                                 \*ixlvl=1
  3125.                           \else \*ixlvl=#1\fi
  3126.    \def\respectcase##1{\edef\T{yes}
  3127.                        \edef\U{no}
  3128.                        \edef\V{##1}
  3129.                        \ifx \T\V \B={case=yes}
  3130.                             \else \B={case=no}
  3131.                                   \ifx \U\V             % Already set
  3132.                                        \else\message{<TEXT1> Error!! Case respect not "yes"
  3133.                                                       or "no" in indexformat. "no" will be used.}
  3134.                              \fi\fi
  3135.                        \ifcase \*ixlvl \or \global\*ixarc=\B
  3136.                                        \or \global\*ixbrc=\B
  3137.                                        \or \global\*ixcrc=\B
  3138.                              \fi}
  3139.    \def\style##1{\edef\T{paragraph}
  3140.                  \edef\U{dash}
  3141.                  \edef\V{indent}
  3142.                  \edef\W{##1}
  3143.                  \ifx \T\W \B={style=1}             % paragraph style
  3144.                       \else \ifx \U\W \B={style=2}  % dash style
  3145.                             \else \B={style=3}      % indented style
  3146.                                   \ifx \V\W                % Already done
  3147.                                        \else \message{<TEXT1> Error!! Style invalid in indexformat.
  3148.                                                       "indented" will be used.}
  3149.                       \fi\fi\fi
  3150.                        \ifcase \*ixlvl \or \global\*ixast=\B
  3151.                                        \or \global\*ixbst=\B
  3152.                                        \or \global\*ixcst=\B
  3153.                              \fi}
  3154.    \def\leadering##1{\edef\T{yes}
  3155.                      \edef\U{no}
  3156.                      \edef\V{##1}
  3157.                      \ifx\T\V \B={leadering=yes}
  3158.                         \else \B={leadering=no}
  3159.                               \ifx\U\V
  3160.                                       \else \message{<TEXT1> Error!! Only "yes" and "no" can
  3161.                                                     be used in the indexformat. "no" will be assumed.}
  3162.                               \fi\fi
  3163.                      \ifcase \*ixlvl \or \global\*ixald=\B
  3164.                                      \or \global\*ixbld=\B
  3165.                                      \or \global\*ixcld=\B
  3166.                              \fi
  3167.            }
  3168.    \long\def\everyletterbreak##1{\ifcase \*ixlvl \or \global\*ixabr={##1}
  3169.                                                  \or \global\*ixbbr={##1}
  3170.                                                  \or \global\*ixcbr={##1}
  3171.                               \fi}
  3172.    \def\everyindex##1{\ifcase \*ixlvl \or \global\*ixaev={##1}
  3173.                                       \or \global\*ixbev={##1}
  3174.                                       \or \global\*ixcev={##1}
  3175.                               \fi}
  3176.    \def\everyhang##1{\ifcase \*ixlvl \or \global\*ixahp={##1}
  3177.                                      \or \global\*ixbhp={##1}
  3178.                                      \or \global\*ixchp={##1}
  3179.                               \fi}
  3180.    \def\indentsubentry##1##2{\R = ##1
  3181.                        \ifnum ##1<1 \message{<TEXT1> Error!! Subentry level number in indexformat
  3182.                                              may only be 1 or 2. 1 will be used.}
  3183.                                     \R = 1
  3184.                               \else \ifnum ##1>2 \message{<TEXT1> Error!! Subentry level number in indexformat
  3185.                                              may only be 1 or 2. 1 will be used.}
  3186.                                     \R = 1
  3187.                               \fi\fi
  3188.                      \ifcase \R \or \ifcase \*ixlvl \or \global\*ixasea={##2}
  3189.                                                     \or \global\*ixbsea={##2}
  3190.                                                     \or \global\*ixcsea={##2}
  3191.                                                 \fi
  3192.                                     \or \ifcase \*ixlvl \or \global\*ixaseb={##2}
  3193.                                                         \or \global\*ixbseb={##2}
  3194.                                                         \or \global\*ixcseb={##2}
  3195.                                                 \fi
  3196.                               \fi}
  3197.    #2}}
  3198. \newwrite\*ixfilea                    % IndeX FILE A
  3199. \newwrite\*ixfileb                    % IndeX FILE B
  3200. \newwrite\*ixfilec                    % IndeX FILE C
  3201. \newif\if*ixaopen   \*ixaopenfalse    % IndeX file A OPEN?
  3202. \newif\if*ixbopen   \*ixbopenfalse    % IndeX file B OPEN?
  3203. \newif\if*ixcopen   \*ixcopenfalse    % IndeX file C OPEN?
  3204. \def\*openixfile#1{\ifcase #1 \or
  3205.             \immediate\openout\*ixfilea=text1$$.IX1%
  3206.             \global\*ixaopentrue
  3207.             \immediate\write\*ixfilea{\the\*ixarc}%
  3208.             \immediate\write\*ixfilea{\the\*ixast}%
  3209.             \immediate\write\*ixfilea{\the\*ixald}%
  3210.   \or       \immediate\openout\*ixfileb=text1$$.IX2%
  3211.             \global\*ixbopentrue
  3212.             \immediate\write\*ixfileb{\the\*ixbrc}%
  3213.             \immediate\write\*ixfileb{\the\*ixbst}%
  3214.             \immediate\write\*ixfileb{\the\*ixbld}%
  3215.   \or       \immediate\openout\*ixfilec=text1$$.IX3%
  3216.             \global\*ixcopentrue
  3217.             \immediate\write\*ixfilec{\the\*ixcrc}%
  3218.             \immediate\write\*ixfilec{\the\*ixcst}%
  3219.             \immediate\write\*ixfilec{\the\*ixcld}%
  3220.   \fi}
  3221. {\catcode`\$=12
  3222. \global\def\index#1#2{{\global\*ixpn = 2
  3223.                 \def\subentry##1##2{${$}se##1##2{$}}%
  3224.                 \def\bdpn{\global\*ixpn = 0}%
  3225.                 \def\uspn{\global\*ixpn = 4}%
  3226.                 \def\itpn{\global\*ixpn = 6}%
  3227.                 \def\blindentry##1{\global\*ixpn = 9}%
  3228.                 \def\sortas##1{${$}sa##1{$}}%
  3229.                 \def\dagger{ \noexpand\dagger}%
  3230.                 \def\ddagger{ \noexpand\ddagger}%
  3231.                 \def\\{\noexpand\\}%
  3232.                 \def\{{\noexpand\{}%
  3233.                 \def\}{\noexpand\}}%
  3234.                 \def\_{\noexpand\_}%
  3235.                 \def\@{\noexpand\@}%
  3236.                 \def\S{\noexpand\S}%
  3237.                 \def\P{\noexpand\P}%
  3238.                 \def\L{\noexpand\L}%
  3239.                 \def\AA{\noexpand\AA}%
  3240.                 \def\neg{\noexpand\neg}%
  3241.                 \def\tilde{\noexpand\tilde}%
  3242.                 \def\vbar{\noexpand\vbar}%
  3243.                 \def\roman{\noexpand\rm}\let\rm=\roman%
  3244.                 \def\bold{\noexpand\bd}\let\bd=\bold%
  3245.                 \def\italic{\noexpand\it}\let\it=\italic%
  3246.                 \def\typewriter{\noexpand\tt}\let\tt=\typewriter%
  3247.                 \def\caps{\noexpand\cc}\let\cc=\caps%
  3248.                 \def\mathitalic{\noexpand\mi}\let\mi=\mathitalic%
  3249.                 \def\symbol{\noexpand\sy}\let\sy=\symbol%
  3250.                 \def\extension{\noexpand\ex}\let\ex=\extension%
  3251.                 \def\bolditalic{\noexpand\bi}\let\bi=\bolditalic%
  3252.                 \setbox0=\vbox{\hsize=100in#2}%
  3253.                 \def\bdpn{}%
  3254.                 \def\uspn{}%
  3255.                 \def\itpn{}%
  3256.                 \def\blindentry##1{${$}be##1{$}}%
  3257.                 \*ixlvl = #1
  3258.                 \ifcase #1 \message{<TEXT1> Error!! You can only have index level 1, 2, or 3.
  3259.                                      Index level 1 will be used.}
  3260.                             \*ixlvl = 1
  3261.                             \or\or\or%           % These levels are ok
  3262.                       \else \message{<TEXT1> Error!! You can only have index level 1, 2, or 3.
  3263.                                      Index level 1 will be used.}
  3264.                             \*ixlvl = 1
  3265.                         \fi%
  3266.                 \edef\*ixtoken{#2}%
  3267.                 \edef\temp{\*ixtoken}%
  3268.                 \ifcase \*ixlvl  \or\if*ixaopen\else\*openixfile1\fi% Open the file if not done yet
  3269.                                    \immediate\write\*ixfilea{{\the\*ixpn}{\the\pageno}{\pagenumber}\*ixtoken}%
  3270.                                  \or \if*ixbopen \else \*openixfile2 \fi % Open the file if not done yet
  3271.                                    \immediate\write\*ixfileb{{\the\*ixpn}{\the\pageno}{\pagenumber}\*ixtoken}%
  3272.                                  \or \if*ixcopen \else \*openixfile3 \fi % Open the file if not done yet
  3273.                                    \immediate\write\*ixfilec{{\the\*ixpn}{\the\pageno}{\pagenumber}\*ixtoken}%
  3274.                                  \fi}\ignorespaces}
  3275. }% End math cat code change
  3276. \def\everyletterbreak#1#2{\def\nextletter{#2}
  3277.                           \ifcase #1 \or \the\*ixabr
  3278.                                      \or \the\*ixbbr
  3279.                                      \or \the\*ixcbr
  3280.                               \fi}
  3281. \def\everyindex#1{\ifcase \*ixlvl \or \the\*ixaev
  3282.                                   \or \the\*ixbev
  3283.                                   \or \the\*ixcev
  3284.                               \fi}
  3285. \def\indentsubentry#1#2{\par\penalty5000\hp
  3286.                      \ifcase #2 \or \ifcase #1 \or \hs{\the\*ixasea}
  3287.                                                \or \hs{\the\*ixbsea}
  3288.                                                \or \hs{\the\*ixcsea}
  3289.                                                 \fi
  3290.                                 \or \ifcase #1 \or \hs{\the\*ixaseb}
  3291.                                                \or \hs{\the\*ixbseb}
  3292.                                                \or \hs{\the\*ixcseb}
  3293.                                                 \fi
  3294.                               \fi}
  3295. \let\ix=\index
  3296. \let\*ix=\printindex
  3297. \def\printindex#1{\*ix#1
  3298.                   \ifcase #1 \or \input text1$$.ix1
  3299.                              \or \input text1$$.ix2
  3300.                              \or \input text1$$.ix3
  3301.                              \fi}
  3302. \def\@{\char'100{}}%
  3303. %
  3304. %   and set default values
  3305. %
  3306. \hfuzz=1pt
  3307. \parindent=24pt          \parskip=0pt plus 3pt minus 0pt
  3308. \normalbottom
  3309. \pageno=0
  3310. \catcode`* = 12
  3311. % The END
  3312.